Skip to content

Commit 3f7d44d

Browse files
davidlemaitredkd-kaehm
authored andcommitted
[BUGFIX] Initialize the localRootLine property before usage
This change ensures that the root line is initialized before being accessed on TSFE initialization. Fixes: #4287 Ports: #4423
1 parent c9b7117 commit 3f7d44d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Classes/FrontendEnvironment/Tsfe.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use TYPO3\CMS\Core\SingletonInterface;
3737
use TYPO3\CMS\Core\Site\SiteFinder;
3838
use TYPO3\CMS\Core\Utility\GeneralUtility;
39+
use TYPO3\CMS\Core\Utility\RootlineUtility;
3940
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
4041
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
4142
use TYPO3\CMS\Frontend\Page\PageInformation;
@@ -111,6 +112,10 @@ protected function initializeTsfe(int $pageId, int $language = 0, ?int $rootPage
111112
$pageInformation->setId($pageId);
112113
$pageInformation->setPageRecord(BackendUtility::getRecord('pages', $pageId));
113114
$pageInformation->setContentFromPid($pageId);
115+
116+
$rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageId)->get();
117+
$pageInformation->setLocalRootLine($rootLine);
118+
114119
$serverRequest = $this->serverRequestCache[$cacheIdentifier] ?? null;
115120
$pageArguments = GeneralUtility::makeInstance(PageArguments::class, $pageId, '0', []);
116121
if (!isset($this->serverRequestCache[$cacheIdentifier])) {

0 commit comments

Comments
 (0)