Project

General

Profile

Actions

Bug #71348

closed

TypoScript is cut off under some circumstances

Added by Alexander Grein over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Start date:
2015-11-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Alexander Grein over 8 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;

Actions #2

Updated by Riccardo De Contardi over 8 years ago

  • Target version changed from 6.2.16 to Candidate for patchlevel
Actions #3

Updated by Wouter Wolters over 8 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.

Actions

Also available in: Atom PDF