Commit ba1203bb authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Temporarily disable group access check

To support editors, the page module checks
whether configured shortcut targets exist
and if they are accessible in the frontend
(e.g. not hidden). Otherwise, a info box is
displayed on the page, defining the shortcut.

However, in case a target page has group
restrictions defined (`pages.fe_group`), it
was previously declared as non accessible,
since no frontend group context exists in
backend.

This is now fixed by disabling the group
access, while searching for target pages.

Resolves: #96184
Releases: main, 11.5
Change-Id: I173dfc4b6c5877a3a3ab458e890530fc167712aa
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72471

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Achim Fritz's avatarAchim Fritz <af@achimfritz.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Achim Fritz's avatarAchim Fritz <af@achimfritz.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 87e24f00
......@@ -398,6 +398,12 @@ class PageLayoutController
$state = InfoboxViewHelper::STATE_ERROR;
if ($shortcutMode || $this->pageinfo['shortcut']) {
// Store the current group access clause and unset it afterwards since it should
// not be used while searching for configured shortcut pages. Actually ->getPage()
// would allow to disable it via an argument. However, getMenu() currently does not.
// @todo Refactor as soon as ->getMenu() allows to dynamically disable group access check
$tempGroupAccess = $this->pageRepository->where_groupAccess;
$this->pageRepository->where_groupAccess = '';
switch ($shortcutMode) {
case PageRepository::SHORTCUT_MODE_NONE:
$targetPage = $this->getTargetPageIfVisible($this->pageRepository->getPage($this->pageinfo['shortcut']));
......@@ -422,6 +428,7 @@ class PageLayoutController
$state = InfoboxViewHelper::STATE_INFO;
break;
}
$this->pageRepository->where_groupAccess = $tempGroupAccess;
$message = htmlspecialchars($message);
if ($targetPage !== [] && $shortcutMode !== PageRepository::SHORTCUT_MODE_RANDOM_SUBPAGE) {
$linkToPid = $this->uriBuilder->buildUriFromRoute($this->moduleName, ['id' => $targetPage['uid']]);
......
Supports Markdown
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