Bug #58339
closedWrong returning from ->extGetFeAdminValue
100%
Description
$GLOBALS['BE_USER']->adminPanel->extGetFeAdminValue('preview', 'simulateUserGroup'); or $GLOBALS['BE_USER']->adminPanel->extGetFeAdminValue('preview', 'simulateDate');
returns 1 if they set to 0
In ->extGetFeAdminValue it will return the value from override.preview = 1 if e.g. 'override.preview.simulateUserGroup' is not set, empty or 0
I think asking for 'override.preview.simulateUserGroup' and returning 'override.preview' is a wrong behavior.
admPanel { ... override.preview = 1 override.preview.simulateUserGroup = 0 override.preview.simulateDate = 0 ... }
My Reasons for that:
With EXT:simulatebe i have an FE User and BE User online. The Adminpanel is hidden. To Respect the Usergroups from the FE User I have to set simulateUserGroup to False but will have the preview = 1 at the same time.
The same with simulateDate. I show content that depends on $GLOBALS['SIM_EXEC_TIME'] but this is always '1' when I logged in and have editing rights.
Fix: Change
if ($val && $GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val]) {
in /typo3/sysext/frontend/Classes/View/AdminPanelView.php to
if ($val && isset($GLOBALS['BE_USER']->extAdminConfig['override.'][$sectionName . '.'][$val])) {
If nothing is set the behavior is like before (so i assume nothing will break), but it returns not '1' if '= ' or '= 0' is set.
This is a bug in older t3cms versions too.
Files