[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:core-ci <typo3@b13.com> Reviewed-by:
Andreas Kienast <a.fernandez@scripting-base.de> Tested-by:
Andreas Kienast <a.fernandez@scripting-base.de>
Showing
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 5 additions, 0 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
- typo3/sysext/frontend/Classes/Event/ModifyTypoScriptConstantsEvent.php 43 additions, 0 deletions...frontend/Classes/Event/ModifyTypoScriptConstantsEvent.php
Please register or sign in to comment