diff --git a/Classes/ContentObject/Menu/AbstractMenuContentObject.php b/Classes/ContentObject/Menu/AbstractMenuContentObject.php
index 8c8c43f5..02042f5a 100644
--- a/Classes/ContentObject/Menu/AbstractMenuContentObject.php
+++ b/Classes/ContentObject/Menu/AbstractMenuContentObject.php
@@ -1219,7 +1219,11 @@ abstract class AbstractMenuContentObject
if (!$this->mconf['SPC'] && $isSpacerPage) {
return false;
}
- // Page may not be a 'Backend User Section' or any other excluded doktype
+ $languageId = $this->getCurrentLanguageAspect()->getId();
+ // PageID should not be banned (check for default language pages as well)
+ if (($data['_PAGES_OVERLAY_UID'] ?? 0) > 0 && in_array((int)($data['_PAGES_OVERLAY_UID'] ?? 0), $banUidArray, true)) {
+ return false;
+ }
if (in_array((int)$data['doktype'], $this->excludedDoktypes, true)) {
return false;
}
@@ -1236,9 +1240,9 @@ abstract class AbstractMenuContentObject
return false;
}
// Checking if "&L" should be modified so links to non-accessible pages will not happen.
- if ($this->getCurrentLanguageAspect()->getId() > 0 && $this->conf['protectLvar']) {
+ if ($languageId > 0 && !empty($this->conf['protectLvar'])) {
if ($this->conf['protectLvar'] === 'all' || GeneralUtility::hideIfNotTranslated($data['l18n_cfg'])) {
- $olRec = $this->sys_page->getPageOverlay($data['uid'], $this->getCurrentLanguageAspect()->getId());
+ $olRec = $this->sys_page->getPageOverlay($data['uid'], $languageId);
if (empty($olRec)) {
// If no page translation record then page can NOT be accessed in
// the language pointed to by "&L" and therefore we protect the link by setting "&L=0"
@@ -1674,8 +1678,10 @@ abstract class AbstractMenuContentObject
if ($languageId && $hideIfNotTranslated && !$theRec['_PAGES_OVERLAY']) {
continue;
}
- // No valid subpage if the subpage is banned by excludeUidList
- if (in_array((int)$theRec['uid'], $bannedUids, true)) {
+ if (($theRec['_PAGES_OVERLAY_UID'] ?? 0) > 0 && in_array((int)($theRec['_PAGES_OVERLAY_UID'] ?? 0), $bannedUids, true)) {
+ continue;
+ }
+ if (in_array((int)($theRec['uid'] ?? 0), $bannedUids, true)) {
continue;
}
$hasSubPages = true;