[FOLLOWUP][BUGFIX] PageLayoutController must only use available actions for view... 20/44420/2
authorAndreas Allacher <andreas@allacher.com>
Fri, 30 Oct 2015 17:36:12 +0000 (18:36 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 31 Oct 2015 10:35:27 +0000 (11:35 +0100)
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: Ief52e837a478217d9436f2620da6c953afa72102
Resolves: #70767
Releases: master
Reviewed-on: https://review.typo3.org/44420
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php

index 7c7c675..e2c5e07 100755 (executable)
@@ -444,14 +444,16 @@ class PageLayoutController
         $actionMenu->setLabel('');
 
         $defaultKey = null;
+        $foundDefaultKey = false;
         foreach ($availableActionArray as $key => $action) {
             $menuItem = $actionMenu
                 ->makeMenuItem()
                 ->setTitle($action)
                 ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[function]=' . $key);
 
-            if (!isset($defaultKey)) {
+            if (!$foundDefaultKey) {
                 $defaultKey = $key;
+                $foundDefaultKey = true;
             }
             if ((int)$this->MOD_SETTINGS['function'] === $key) {
                 $menuItem->setActive(true);