Commit ad17c45c authored by Marvin Dosse's avatar Marvin Dosse Committed by Benni Mack
Browse files

[BUGFIX] Allow shortcuts to pages with doktype > 200

Pages with doktype > 200 had not been considered in the sql query.
Now all doktypes are being fetched except for the spacer,
sysfolder and recycler.

Resolves: #94814
Releases: master, 10.4
Change-Id: I8a0165ceaccd89724501ecd01bfba6cebad6efa4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70492


Reviewed-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: default avatarMarvin Dosse <marvindosse@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarMarvin Dosse <marvindosse@gmail.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 338c01c0
......@@ -975,7 +975,13 @@ class PageRepository implements LoggerAwareInterface
switch ($shortcutMode) {
case self::SHORTCUT_MODE_FIRST_SUBPAGE:
case self::SHORTCUT_MODE_RANDOM_SUBPAGE:
$pageArray = $this->getMenu($idArray[0] ?: $thisUid, '*', 'sorting', 'AND pages.doktype<199 AND pages.doktype!=' . self::DOKTYPE_BE_USER_SECTION);
$excludedDoktypes = [
self::DOKTYPE_SPACER,
self::DOKTYPE_SYSFOLDER,
self::DOKTYPE_RECYCLER,
self::DOKTYPE_BE_USER_SECTION,
];
$pageArray = $this->getMenu($idArray[0] ?: $thisUid, '*', 'sorting', 'AND pages.doktype NOT IN (' . implode(', ', $excludedDoktypes) . ')');
$pO = 0;
if ($shortcutMode == self::SHORTCUT_MODE_RANDOM_SUBPAGE && !empty($pageArray)) {
$pO = (int)random_int(0, count($pageArray) - 1);
......
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