Bug #94150
closedConstants in Page TsConfig with multiple sites, caching problem
100%
Description
I think there is a problem with caching in \TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser, because it doesn't use the current site config in the cache identifier.
My test case with two sites:
config/sites/site-a/config.yaml:
rootPageId: 1 settings: access: groupid: 1
config/sites/site-b/config.yaml:
rootPageId: 2 settings: access: groupid: 2
Page TsConfig:
TCEMAIN { permissions { groupid = {$access.groupid} } }
Clear the cache and then open the info modul and have a look at the page tsconfig for site-a, then {$access.groupid} is replaced with "1". But on site-b {$access.groupid} is not replaced.
Clear the cache again and open site-b first. Now {$access.groupid} is replaced on site-b with "2" but not on site-a.
Another test is to create pages and check the access rights in the Access module. The first site has the group set, the second site has no group set.
The related code should be in PageTsConfigParser:parse(). If I change `$hashOfContent = md5('PAGES:' . $content);` to `$hashOfContent = md5('PAGES:' . $content) . ($site ? $site->getIdentifier() : '');` then it works. But I'm not sure, if this is the best solution. I tested with 10.4 but the code in master is still the same. So the problem should exist there, too.
As a hotfix without changing the core an integrator can use good old conditions in the page TsConfig :-)
[1 in tree.rootLineIds] TCEMAIN { permissions { groupid = 1 } } [GLOBAL] [2 in tree.rootLineIds] TCEMAIN { permissions { groupid = 2 } } [GLOBAL]
Updated by Marco Huber over 3 years ago
- Related to Feature #91080: Populate site settings to TypoScript constants added
Updated by Marco Huber over 3 years ago
- Related to Feature #91081: Populate site settings to TSconfig added
Updated by Marco Huber over 3 years ago
- Related to Bug #92528: TypoScript site constants not always populated added
Updated by Marco Huber over 3 years ago
Instead of modifying $hashOfContent perhaps it would be better to do the Constants stuff in the beginning of the parse function before checking the cache. I think in \TYPO3\CMS\Core\TypoScript\TemplateService the Constants are replaced very early, too.
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/+/69175
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/+/69201
Updated by Marco Huber over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6a40c1e71a17184e0fea8abb96d3dfe8f68fafb0.