Skip to content
Snippets Groups Projects
Commit 54cbbd9f authored by Julian Mair's avatar Julian Mair Committed by Andreas Kienast
Browse files

[TASK] Have an event to modify constants AST in FE

The new v12 TypoScript parser removed one undocumented
feature of the old parser in particular: Nested constants.

The core does not implement this anymore since it is
extremely hard to find a solution that scales well. The
problem becomes complicated with recursive usage
combined with values that may change at any point.

There are however a couple of instances that need this
feature and can't migrate away easily or at least not
without giving them a longer transition timeframe.

For this reason, the patch introduces an event in the
Frontend rendering chain that allows listeners to
manipulate the calculated constants AST structure.
This gives event listeners a chance to traverse the
calculated FE constants AST before it is cached and
further processed.

Implementing a resolver of nested constants should be
possible this way, even though extensions probably
restrict their implementation to limited scenarios.

This event is essentially a "last resort" solution: It
works in an environment where the AST is still marked
internal, and where the dispatching may still be
moved around to other places.

As such, this event is *not* marked as official feature.
It does not come with a ReST file, and it may change or
vanish in future major versions in case it becomes a
headache during further development. It is tailored for
developers who can't move away from nested constants and
need an intermediate solution right now.

Resolves: #101752
Releases: main, 12.4
Change-Id: Idd6fb12e0bf53ae48d0f3f790f792655ab217b5b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81652


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
parent 2f9415bb
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment