Project

General

Profile

Actions

Bug #88374

closed

[xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request

Added by Dima Nozdrin almost 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-05-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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

2019-05-16--15-10-19.png (94.6 KB) 2019-05-16--15-10-19.png cache regenerated Dima Nozdrin, 2019-05-16 14:22
2019-05-16--15-10-03.png (95.1 KB) 2019-05-16--15-10-03.png cache created the first time Dima Nozdrin, 2019-05-16 14:22

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #85829: Implement symfony expression language for TypoScript conditionsClosedFrank Nägler2018-08-13

Actions
Related to TYPO3 Core - Bug #90257: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each requestClosed2020-01-30

Actions
Has duplicate TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pagesClosed2018-11-02

Actions
Actions #1

Updated by Dima Nozdrin almost 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
Actions #2

Updated by Dima Nozdrin almost 5 years ago

  • Target version set to Candidate for patchlevel
Actions #3

Updated by Dima Nozdrin almost 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

Actions #4

Updated by Dima Nozdrin almost 5 years ago

  • Target version deleted (Candidate for patchlevel)
  • Private changed from No to Yes
  • Complexity set to hard
Actions #5

Updated by Dima Nozdrin almost 5 years ago

  • Private changed from Yes to No
Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Dima Nozdrin almost 5 years ago

  • Related to Feature #85829: Implement symfony expression language for TypoScript conditions added
Actions #8

Updated by Dima Nozdrin almost 5 years ago

  • Complexity changed from hard to easy
Actions #9

Updated by Markus Klein almost 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.

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Gerrit Code Review almost 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

Actions #14

Updated by Gerrit Code Review almost 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

Actions #15

Updated by Dima Nozdrin almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Gerrit Code Review almost 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

Actions #17

Updated by Gerrit Code Review almost 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

Actions #18

Updated by Gerrit Code Review almost 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

Actions #19

Updated by Dima Nozdrin almost 5 years ago

  • Status changed from Under Review to Resolved
Actions #20

Updated by Daniel Siepmann over 4 years ago

  • Has duplicate Bug #86837: TypoScript Condition: tree.* broken on cached pages added
Actions #21

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions #22

Updated by Wiebke Lauke about 4 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

Actions #23

Updated by Benni Mack over 1 year ago

  • Related to Bug #90257: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request added
Actions

Also available in: Atom PDF