Project

General

Profile

Actions

Bug #94150

closed

Constants in Page TsConfig with multiple sites, caching problem

Added by Marco Huber over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2021-05-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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]


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #91080: Populate site settings to TypoScript constantsClosedBenni Mack2020-04-17

Actions
Related to TYPO3 Core - Feature #91081: Populate site settings to TSconfigClosedBenni Mack2020-04-17

Actions
Related to TYPO3 Core - Bug #92528: TypoScript site constants not always populatedClosed2020-10-09

Actions
Actions

Also available in: Atom PDF