Project

General

Profile

Actions

Bug #106180

open

Building the local rootline fails to detect root systemplate if page has multiple template records

Added by Jigal van Hemert 29 days ago. Updated 24 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2025-02-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Actions #1

Updated by Christian Kuhn 25 days ago

Actions #2

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

Actions

Also available in: Atom PDF