#22122SIM_EXEC_TIME is always 1 when logged in BE
Description
When I’m logged in BE and preview pages – $GLOBALS[‘SIM_EXEC_TIME’] always gets == 1.
I got the following TS for the user (cause of feeditadvanced ext):
admPanel {
…
override.preview = 1
override.edit.displayIcons = 1
override.preview.showHiddenRecords = 1
override.preview.showHiddenPages = 1
…
}
Reason:
1) typo3/sysext/cms/tslib/class.tslib_fe.php:781-785
$simTime = $GLOBALS[‘BE_USER’]->adminPanel->extGetFeAdminValue(‘preview’, ‘simulateDate’);
if ($simTime) {
$GLOBALS[‘SIM_EXEC_TIME’] = $simTime;
$GLOBALS[‘SIM_ACCESS_TIME’] = $simTime – ($simTime % 60);
}
So, SIM_EXEC_TIME gets overriden if admPanel.override.preview.simulateDate is not empty. Thats correct.
2) typo3/sysext/cms/tslib/class.tslib_adminpanel.php:197-202
Seems to work incorreclty, because
a) if admPanel.override.preview.simulateDate is present in TS and = 0, this condition fails:
if ($GLOBALS[‘BE_USER’]->extAdminConfig[‘override.’][$pre . ‘.’][$val] && $val) {
b) this behaviour is quite strange:
if ($GLOBALS[‘BE_USER’]->extAdminConfig[‘override.’][$pre]) {
return $GLOBALS[‘BE_USER’]->extAdminConfig[‘override.’][$pre];
}
It results in: if admPanel.override.preview.simulateDate is not present, admPanel.override.preview is returned instead, which is = 1 in my case.
I suggest to fix line 197 to such:
if (isset($GLOBALS[‘BE_USER’]->extAdminConfig[‘override.’][$pre . ‘.’][$val]) && $val) {
so check should be done not for emptyness, but for existence.
(issue imported from #M13544)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.