Bug #106180
openBuilding the local rootline fails to detect root systemplate if page has multiple template records
0%
Description
Situation:
For historical reasons there is a central "page" which is the parent of all web site roots in the installation.
"TYPO3 root" <- contains root sys_template record +- "Site 1" <- contains root sys_template record | +- page 1 +- "Site 2" <- contains root sys_template record
If "Site 1" contains a sys_template record with the "root" property set and one or more sys_template records without the "root" property set, building the local rootline may fail to detect the "root" property.
First an array is created with the "pid" as key and the sys_template as value. With multiple sys_template records in a page the second (and third) record will overwrite the first one. If only the first one has the "root" option set the page will not be recognized as root page.
One effect is that HMENU will not use that page as the root of the menu.
This happens in v12 in \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFromCache()
, in v13 in \TYPO3\CMS\Frontend\Page\PageInformationFactory::setLocalRootLine()
(haven't checked v14 yet)
The solution is to build $sysTemplateRowsIndexedByPid
with an array of systemplateRows and loop through them to check $sysTemplateRowsIndexedByPid[$pageId]['root']
for each of the sys template rows.
Note: the pagetree structure is a bit non-standard but has been working since v 4.x. The multiple sys_template records per page are in this situation caused by virtual TS templates which are added by a AfterTemplatesHaveBeenDeterminedEvent
listener
Updated by Christian Kuhn 25 days ago
- Related to Feature #97816: New TypoScript parser added
Updated by Gerrit Code Review 24 days ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88283