Bug #88374
closed[xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request
100%
Description
For example condition
[123 in tree.rootLineIds]
...
[END]
will cause page cache regeneration on each load for all pages that contain 123 in their rootline.
Tested on TYPO3 9.5.7
The issue can be may tracked in
TypoScriptFrontendController::createHashBase
The condition is not taken into account in
$this->all['matches']
while calculating hash in order to fetch page caches.As a result cache-hash of the page that is being loaded is not equal the cache that was created for this page before.
Files
Updated by Dima Nozdrin over 5 years ago
- Subject changed from [xxx in tree.rootLineIds] causes page cache regeneration on each request to [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request
Updated by Dima Nozdrin over 5 years ago
- Target version set to Candidate for patchlevel
Updated by Dima Nozdrin over 5 years ago
The reason of the issue is the fact that condition does not match even if it should. The right part of the conditions is not evaluated to a correct array of ids.
While rootline data is set by setRootline() method in
TYPO3\CMS\Core\TypoScript\TemplateService::matching()
rootLineIds are fetched only in
TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
constructor
Updated by Dima Nozdrin over 5 years ago
- Target version deleted (
Candidate for patchlevel) - Private changed from No to Yes
- Complexity set to hard
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Dima Nozdrin over 5 years ago
- Related to Feature #85829: Implement symfony expression language for TypoScript conditions added
Updated by Markus Klein over 5 years ago
Technical problem description¶
The code dealing with data coming from cache instantiates the ConditionMatcher and calls the setter to pass along the rootline loaded from cache to the matcher. This code is in place since a long time.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L1625
calls
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/TypoScript/TemplateService.php#L387
With the introduction of the new ConditionMatcher the code inside the matcher has been adjusted to initialize the internal rootline stuff within the constructor.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php#L45
Specifically the expressionLanguageResolver
receives the rootline information.
At this point the rootline is fetched from $GLOBALS['TSFE']->tmpl->rootLine
which is empty in case a page is coming from cache.
Unfortunately it has been forgotten to re-initialize the expressionLanguageResolver
if the rootline inside the condition matcher is modified via the setRootline
method.
This causes the described issue here, as the condition matcher has no clue about the current rootline and hence the conditions don't match.
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Gerrit Code Review over 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Gerrit Code Review over 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Gerrit Code Review over 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Gerrit Code Review over 5 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60771
Updated by Dima Nozdrin over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6d8087071693e5e7a3b9b4ac4b2b7e4344617853.
Updated by Gerrit Code Review over 5 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61000
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61000
Updated by Gerrit Code Review over 5 years ago
Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61000
Updated by Dima Nozdrin over 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset b36be53157b494cff50b0b516d62d025fb14aa0a.
Updated by Daniel Siepmann about 5 years ago
- Has duplicate Bug #86837: TypoScript Condition: tree.* broken on cached pages added
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed
Updated by Wiebke Lauke almost 5 years ago
Hi folks,
that bug still exists in TYPO3 9.5.13.
The following condition works fine in Application Context "Development" (no cache) but doesn't work in Application Context "Production" (caching).
[123 in tree.rootLineIds]
# add a class to body tag
[GLOBAL]
Can anyone reopen this ticket?
Thanks,
Wiebke
Updated by Benni Mack about 2 years ago
- Related to Bug #90257: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request added