Bug #71348
closedTypoScript is cut off under some circumstances
0%
Description
Under some circumstances TypoScript code is cut off at the end, which could result into a fail of the hole rendering.
TypoScript code added by using ExtensionManagementUtility::addTypoScript(), will be added to $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_' . $type . '.']['defaultContentRendering'] (line 1478 of code)
This TypoScript code will be read out from this array var inside "TyposcriptParser::checkIncludeLines()" in line 834
The fatal problem is in line 841:
$string = substr($newString, 1, -1);
Because of this, the last and first sign of every TypoScript code block is deleted, independent wether there is a relevant code like a closing "}" or just a line break.
Updated by Alexander Grein about 9 years ago
Changing line 834 of typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php from this:
$newString .= $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_' . $includeType . '.']['defaultContentRendering'];
to this:
$newString .= $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_' . $includeType . '.']['defaultContentRendering'] . LF;
solves the problem.
An other possibility, and may be better/safer is the solution taken from the current master:
Turn this in line 841:
$string = substr($newString, 1, -1);
to this:
$string = LF . trim($newString) . LF;
Updated by Riccardo De Contardi almost 9 years ago
- Target version changed from 6.2.16 to Candidate for patchlevel
Updated by Wouter Wolters almost 9 years ago
- Status changed from New to Closed
Hi, this was solved with another ticket. See the commit here https://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff/26001810ea9aa33d59ee524898ae46a8f8f87ef1
Closing this ticket as solved.