Skip to content
Snippets Groups Projects
Commit 3b5196b6 authored by Markus Klein's avatar Markus Klein Committed by Wouter Wolters
Browse files

[BUGFIX] Admin panel extGetFeAdminValue() overrides are wrong

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
parent 795fa7f5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment