Bug #93597
closedAdding a TS template with the runThroughTemplatesPostProcessing hook leads to caching issues
100%
Description
The runThroughTemplatesPostProcessing
hook in TemplateService
is used to add a 'virutal' TS template (based on page properties).
In runThroughTemplates()
each sys_template
record also adds an item to the rowSum
array (happens inside processTemplate()
).
After caches are cleared a hash from rowSum is used as key for caching all conditions. A hash of all matched conditions is used as key for caching all constants and setup.
If two pages only differ in the TS that the hook subscriber adds they will both get the same constants and setup from the cache (rowSum is equal and the same result from the conditions leads to the same key for the constants/setup cache).
If the hook subscriber could add items to rowSum the cache key would be different for both pages.
Example¶
Situation in site:
+-- start <-- virtual TS added: "property=1" +-- page1 +-- page2 <-- virtual TS added: "property=2" | +-- page2.1 | +-- page2.2 +-- page3
If you clear caches, visit page1 first the TS constants and setup are stored in cache. If you visit page2 (or a subpage) after that the rowSum matches, the conditions are the same and thus the constants and setup from page1 are loaded from cache and used for page2 (and subpages).
If you clear caches, visit page2 first that configuration will be used
Updated by Gerrit Code Review over 3 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/+/68153
Updated by Gerrit Code Review over 3 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/+/68153
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 10.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/+/68123
Updated by Jigal van Hemert over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c1e52b9e1075cae6105eae466f9d65dc08e44c66.