[BUGFIX] Admin panel extGetFeAdminValue() overrides are wrong 30/29730/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Tue, 29 Apr 2014 16:58:25 +0000 (18:58 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 5 Jun 2014 20:57:35 +0000 (22:57 +0200)
The current check does not properly consider the override values.
If a override is set, then its value has to be taken.
The current check only considered overrides which had
boolean value TRUE.

Resolves: #58339
Releases: 6.2, 6.1
Change-Id: Ib714432044c6a88fc92dcb8f36a4e37eb3412378
Reviewed-on: https://review.typo3.org/29730
Reviewed-by: Gerrit Mohrmann
Tested-by: Gerrit Mohrmann
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/frontend/Classes/View/AdminPanelView.php

index aa628c7..c42281a 100644 (file)
@@ -163,36 +163,34 @@ class AdminPanelView {
         *
         * @param string $sectionName Module key
         * @param string $val Setting key
-        * @return string The setting value
+        * @return mixed The setting value
         */
        public function extGetFeAdminValue($sectionName, $val = '') {
-               // Check if module is enabled.
-               if ($this->isAdminModuleEnabled($sectionName)) {
-                       // Exceptions where the values can be overridden from backend:
-                       // deprecated
-                       if ($sectionName . '_' . $val == 'edit_displayIcons' && $GLOBALS['BE_USER']->extAdminConfig['module.']['edit.']['forceDisplayIcons']) {
-                               return TRUE;
-                       }
-                       if ($sectionName . '_' . $val == 'edit_displayFieldIcons' && $GLOBALS['BE_USER']->extAdminConfig['module.']['edit.']['forceDisplayFieldIcons']) {
-                               return TRUE;
-                       }
-                       // Override all settings with user TSconfig
-                       if ($val && $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val]) {
-                               return $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val];
-                       }
-                       if ($GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName]) {
-                               return $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName];
-                       }
-                       $retVal = $val ? $GLOBALS['BE_USER']->uc['TSFE_adminConfig'][$sectionName . '_' . $val] : 1;
-                       if ($sectionName == 'preview' && $this->ext_forcePreview) {
-                               return !$val ? TRUE : $retVal;
-                       }
-
-                       // See if the menu is expanded!
-                       if ($this->isAdminModuleOpen($sectionName)) {
-                               return $retVal;
-                       }
+               if (!$this->isAdminModuleEnabled($sectionName)) {
+                       return NULL;
                }
+               // Exceptions where the values can be overridden from backend:
+               // deprecated
+               if ($sectionName . '_' . $val === 'edit_displayIcons' && $GLOBALS['BE_USER']->extAdminConfig['module.']['edit.']['forceDisplayIcons']) {
+                       return TRUE;
+               }
+               if ($sectionName . '_' . $val === 'edit_displayFieldIcons' && $GLOBALS['BE_USER']->extAdminConfig['module.']['edit.']['forceDisplayFieldIcons']) {
+                       return TRUE;
+               }
+               // Override all settings with user TSconfig
+               if ($val && isset($GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val])) {
+                       return $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val];
+               }
+               if (isset($GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName])) {
+                       return $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName];
+               }
+               $retVal = $val ? $GLOBALS['BE_USER']->uc['TSFE_adminConfig'][$sectionName . '_' . $val] : 1;
+               if ($sectionName === 'preview' && $this->ext_forcePreview) {
+                       return !$val ? TRUE : $retVal;
+               }
+
+               // See if the menu is expanded!
+               return $this->isAdminModuleOpen($sectionName) ? $retVal : NULL;
        }
 
        /**