Feature #101752
closedAdd event to the Typoscript FE Controller to let the users replace nested TS constants
100%
Description
As mentioned in #101523, nested (= recursive) Typoscript constants doesn't work anymore since Typo3 v12 cause of the newly introduced TypoScript Parser.
To be fair: it was never a promised/documented feature and there were valid reasons to not implement this in core anymore.
One main reason is that I did not find an acceptable simple solution to implement this better than "O(m) * O(n)" with m being the substitution depth and n the number of nodes in the tree.
(https://forge.typo3.org/issues/101523#note-12)
I hope, even if the core won't implement a complete implemention of this feature, there will be at least an option (like an event or hook) to substitute potential nested constants under the responsibility by the user itself.
Solution:
After the merge (or apply via composer patches) of the patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078 the extension https://packagist.org/packages/m41r/nested-typoscript-constants can be installed as a drop-in-replacement. No further code adjustments needed.
Suggestion:
Dispatch an event after line: https://github.com/TYPO3/typo3/blob/v12.4.5/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L1321 to adjust the $flatSettings property in \TYPO3\CMS\Core\TypoScript\FrontendTypoScript:class (a setter has to be added)
Requested target version:
>= Typo3 v12
Updated by Georg Ringer about 1 year ago
- Related to Bug #101523: Config `page.config.headerComment` can not resolve TS constants anymore added
Updated by Christian Kuhn about 1 year ago
- Related to Feature #97816: New TypoScript parser added
Updated by Christian Kuhn about 1 year ago
Yeah, I came to the same conclusion that we need an event after constant calculation and before setup calculation for extensions to hook in there.
The actual solution / event placement depends a bit on the future fate of the method: It will of course vanish from TSFE and will be put into a middleware (or an extracted factory, maybe with muliple methods, unsure). It might be good to see a bit where this leads to in order to not introduce new b/w compat issues as soon as we do so in v13.
Note: I guess we don't need a setter for the attribute class since an event could just return a new attribute instance. But those are details and involved classes are @internal at the moment anyways ... maybe that's the solution for now: mark an event as "@internal, may change" for now, but still add it. This would reduce the upwards compat issues and if we break it, extensions would have to adapt.
Depending on how we model and inject a future factory, it may even be possible to go without an event, altogether, so an event may be an intermediate solution anyways. Unsure here, too.
Updated by Julian Mair 12 months ago
Hey Christian,
just a quick inquiry: Have you already formulated a plan for implementing the event, or do you have any alternative solutions in mind? I don't mean to rush you; however, I need to provide my supervisors with an interim response. The absence of nested constants is a significant impediment for us in considering the usage or upgrade to Typo3 v12.
Updated by Gerrit Code Review 12 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 12 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 12 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 11 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 11 months ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 11 months ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Gerrit Code Review 11 months ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81078
Updated by Julian Mair 10 months ago
A solution was provided above in the description field
Updated by Gerrit Code Review 10 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81652
Updated by Julian Mair 10 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c5a65771aa3e4cf76c30ac66acefdfcb1d98b5a4.