Bug #56080
closedTitle field gets lost after using addToAllTCAtypes
100%
Description
When using \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( 'sys_category' , 'tx_myfield' , '' , 'after:description' ); the standard title-field of the system category gets lost, because the 't' of the fieldname is being removed.
The bug seems to be the first line in TYPO3\CMS\Core\Utility\ExtensionManagementUtility::executePositionedStringInsertion (line 565). After replacing
"$list = $newList = trim($list, ', \\t\\n\\r\\0\\x0B');"
with
"$list = $newList = trim($list, ', \t\n\r\0\x0B');"
it's working again.
I don't think we need a double backslash at the second trim() parameter as you can see here: http://www.php.net/manual/fr/function.trim.php
Updated by Dominik Weber about 10 years ago
Update: it seems to that the "\\t" or "\t" in trim() removes the first character of the list.
Updated by Michiel Roos about 10 years ago
The tim value needs double quotes: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
Updated by Gerrit Code Review about 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27702
Updated by Markus Klein about 10 years ago
To clarify this. Correct is to use double quotes, but only single backslashes.
Reason: Escape sequences (like \t or \n) are only evaluated in double quoted strings.
(Except \' and \\ in single quoted strings, which escapes the single quote and the backslash there)
Using double backslash escapes the backslash hence the character afterwards is treated as normal character.
Updated by Gerrit Code Review about 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27702
Updated by Gerrit Code Review about 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27702
Updated by Gerrit Code Review about 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27702
Updated by Michiel Roos about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset df139b8a9db2860eb7a1fd0272a83014774722c9.