Project

General

Profile

Actions

Bug #99377

closed

Constant substitution not working

Added by Roman Büchler over 1 year ago. Updated about 1 year ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
Start date:
2022-12-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Using the following typoscript constants

test {
  a = Hi
  b = {$test.a} everybody
}

with the following typoscript setup

page.1 = TEXT
page.1.value = {$test.b}!

produced until TYPO3 v11 the following output:

Hi everybody!

With TYPO3 v12.1 the substitution from a constant used in a constant doesn't work any more and as a result the following will be rendered:

{$test.a} everybody!

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Actions #1

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Accepted
Actions #2

Updated by Christian Kuhn over 1 year ago

  • Status changed from Accepted to Rejected

I'm afraid v12 does not support constants in constants. This has been documented as breaking:

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97816-TypoScriptSyntaxChanges.html#streamlined-constants-usage

Recursive constants were possible with the old parser but are not supported
with the new parser anymore. This was never documented, the Backend Template
module never showed them as resolved, only the Frontend parsed recursive constants.
The simple rule is now: Never access a constant within another constant.
Instances using a construct like the below one need to untie constants.
constants:
foo = fooValue
# This does not resolve to "fooValue" but is kept as string literal "{$foo}" 
bar = {$foo}
Actions #3

Updated by Christian Kuhn over 1 year ago

Actions #4

Updated by Christian Kuhn over 1 year ago

It might be possible to scan for this in my upcoming syntax checker, though. the "template analyzer / Include tree" will then show such violations.

Actions #5

Updated by Kay Strobach about 1 year ago

Ok, where would you kick in to solve that? we have tons of projects using that functionality and this will cause have hefti migration problems.

Actions

Also available in: Atom PDF