Bug #17379
closed
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.
This issue is still the case in TYPO3 6.2.15. Would be really nice if constants also supports multiline.
Now I'm forced to use setup field, but then I lose the inheritance that works with constants.
- Status changed from Closed to New
- TYPO3 Version changed from 4.1 to 6.2
- Is Regression set to No
also exists in current v8, I'm reopening the issue
- Category set to TypoScript
How to test:
Constants
lib.multiline (
line 1
line2
line3
)
setup
page.9 = TEXT
page.9.value = {$lib.multiline}
This will output "line 1" but should all lines.
- PHP Version deleted (
4.3)
- TYPO3 Version changed from 6.2 to 8
This issue is still current in TYPO3 8.7
- Priority changed from Should have to Must have
- TYPO3 Version changed from 8 to 9
This "issue" is still current in TYPO3 9.2.0-dev.
Mathias mentioned in
#59714-1 that multiline TypoScript Constants are not intended. But actually there's
A clear statement would be good. We can take this into the documentation or even fix multiline constants? or maybe some warning/log when (
instead of =
is used in TypoScript constants context.
I wanted to share my research:
Multiline constants actually do work (tested on latest master).
The line break and tabs are preserved.
However the constants value is replaced in the typoscript setup the linebreak will also be added causing it to be invalid typoscript.
The actual replacement happens inside the\TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstants.
A constant
temp.multiTest (
Hello
World
)
with typoscript
page.8 = TEXT
page.8.value = {$temp.multiTest}
results in
page.8 = TEXT
page.8.value = Hello
World
So to fix this we need to change the \TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstantsCallBack method to wrap the constants value in a multiline if it is multiline.
- Status changed from New to Closed
- Priority changed from Must have to Won't have this time
no multiline constants, and documentation updated accordingly.
Also available in: Atom
PDF