Commit df6e0617 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Benni Mack
Browse files

[BUGFIX] Fix "view" option in context menu

The context menu no longer offers the "view" option
for excluded doktypes like "spacer".

Resolves: #93215
Releases: master, 10.4
Change-Id: If9bdcd447c340f052ee12f83f26e4c57c637ec32
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67337

Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent f5ad3545
......@@ -448,7 +448,9 @@ class PageProvider extends RecordProvider
*/
protected function canBeViewed(): bool
{
return !$this->isRoot() && !$this->isDeleted();
return !$this->isRoot()
&& !$this->isDeleted()
&& !$this->isExcludedDoktype();
}
/**
......@@ -616,4 +618,20 @@ class PageProvider extends RecordProvider
}
return true;
}
/**
* Returns true if the page doktype is excluded
*
* @return bool
*/
protected function isExcludedDoktype(): bool
{
$excludeDoktypes = [
PageRepository::DOKTYPE_RECYCLER,
PageRepository::DOKTYPE_SYSFOLDER,
PageRepository::DOKTYPE_SPACER
];
return in_array((int)($this->record['doktype'] ?? 0), $excludeDoktypes, true);
}
}
Markdown is supported
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