Commit 69ac2183 authored by Andreas Allacher's avatar Andreas Allacher Committed by Frank Nägler
Browse files

[BUGFIX] PageLayoutController must only use available actions for view/edit

Ensure that only available actions are shown via PageLayoutController,
e.g. if you remove QuickEdit and the user had previously set the module
to QuickEdit.

Change-Id: Iec8d552965ea351393a218a68ba3166b674ef51b
Resolves: #70767
Releases: master
Reviewed-on: https://review.typo3.org/44082

Reviewed-by: Mathias Schreiber's avatarMathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber's avatarMathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
parent d957a3e5
......@@ -443,16 +443,25 @@ class PageLayoutController
$actionMenu->setIdentifier('actionMenu');
$actionMenu->setLabel('');
$defaultKey = null;
foreach ($availableActionArray as $key => $action) {
$menuItem = $actionMenu
->makeMenuItem()
->setTitle($action)
->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[function]=' . $key);
if (!isset($defaultKey)) {
$defaultKey = $key;
}
if ((int)$this->MOD_SETTINGS['function'] === $key) {
$menuItem->setActive(true);
$defaultKey = null;
}
$actionMenu->addMenuItem($menuItem);
}
if (isset($defaultKey)) {
$this->MOD_SETTINGS['function'] = $defaultKey;
}
$this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($actionMenu);
}
......
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