Skip to content
Snippets Groups Projects
Commit 4e913f2a authored by Susanne Moog's avatar Susanne Moog Committed by Daniel Goerz
Browse files

[BUGFIX] Adjust root line in Condition Matcher

- in frontend tests: match the root line to the actual TSFE root line
- in backend condition matcher: sort the root line similar to frontend
  (in ts config the root line was already manually sorted, this change
   has no impact on core code)

Resolves: #90196
Releases: master, 9.5
Change-Id: Icff65a649f467a82a85ae454585643b978f17e30
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63024


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarTobi Kretschmann <tobi@tobishome.de>
Tested-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarTobi Kretschmann <tobi@tobishome.de>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
parent 7f797955
Branches
Tags
No related merge requests found
......@@ -36,7 +36,11 @@ class ConditionMatcher extends AbstractConditionMatcher
{
$this->context = $context ?? GeneralUtility::makeInstance(Context::class);
$this->pageId = $pageId ?? $this->determinePageId();
$this->rootline = $rootLine ?? BackendUtility::BEgetRootLine($pageId, '', true);
if ($rootLine === null) {
$rootLine = BackendUtility::BEgetRootLine($pageId, '', true);
ksort($rootLine);
}
$this->rootline = $rootLine;
$this->initializeExpressionLanguageResolver();
}
......
......@@ -471,9 +471,9 @@ class ConditionMatcherTest extends FunctionalTestCase
$GLOBALS['TSFE']->sys_page = GeneralUtility::makeInstance(PageRepository::class);
$GLOBALS['TSFE']->tmpl = GeneralUtility::makeInstance(TemplateService::class);
$GLOBALS['TSFE']->tmpl->rootLine = [
2 => ['uid' => 3, 'pid' => 2],
0 => ['uid' => 1, 'pid' => 0],
1 => ['uid' => 2, 'pid' => 1],
0 => ['uid' => 1, 'pid' => 0]
2 => ['uid' => 3, 'pid' => 2],
];
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment