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]