Commit 369ffcbd authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Richard Haeser

[BUGFIX] Hide impossible actions for pid 0

This patch removes some actions that don't make any sense with pid 0:

- toggle visibility in menu via context menu
- "View webpage" action in Record List

Resolves: #93252
Releases: master, 10.4
Change-Id: I444270a49642240e9a38d3664b05923da16f36e0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67367Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Tested-by: default avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Reviewed-by: default avatarRichard Haeser <richard@richardhaeser.com>
parent fb9a9ea8
......@@ -435,7 +435,8 @@ class PageProvider extends RecordProvider
if (!$this->languageAccess) {
return false;
}
return !$this->isDeletePlaceholder()
return !$this->isRoot()
&& !$this->isDeletePlaceholder()
&& !$this->isRecordLocked()
&& !$this->isDeletionDisabledInTS()
&& $this->hasPagePermission(Permission::PAGE_DELETE);
......@@ -589,7 +590,7 @@ class PageProvider extends RecordProvider
*/
protected function canBeToggled(string $fieldName, int $value): bool
{
if (!$this->languageAccess) {
if (!$this->languageAccess || $this->isRoot()) {
return false;
}
if (!empty($GLOBALS['TCA'][$this->table]['columns'][$fieldName]['exclude'])
......
......@@ -502,7 +502,7 @@ class DatabaseRecordList
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
$buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
}
if (!in_array($this->pageRow['doktype'] ?? null, $this->getNoViewWithDokTypes($modulePageTsConfig))) {
if ($this->id !== 0 && !in_array($this->pageRow['doktype'] ?? null, $this->getNoViewWithDokTypes($modulePageTsConfig))) {
$previewDataAttributes = PreviewUriBuilder::create((int)$this->id)
->withRootLine(BackendUtility::BEgetRootLine($this->id))
->buildDispatcherDataAttributes();
......
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