#31139better condition in versionOL of t3lib_tstemplate
Description
Hello Core-Team,
in current TYPO3 4.5.7 you have following method in class.t3lib_tstemplate.php:
function versionOL(&$row) {
if (is_object($GLOBALS['TSFE'])) { // Frontend:
$GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row);
} else { // Backend:
t3lib_BEfunc::workspaceOL('sys_template', $row);
}
}
You only need to set something:
$GLOBALS[‘TSFE’]->register[‘hello’] = 1;
or play with cObj in BE Mode and $GLOBALS[‘TSFE’] get’s a value.
In this case is_object($GLOBALS[‘TSFE’]) returns true, because it is of class stdClass now.
So…to prevent calling $GLOBALS[‘TSFE’]->sys_page->versionOL in BE-Mode it’s better to modify the condition that way:
function versionOL(&$row) {
if (isset($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE']) && get_class($GLOBALS['TSFE']) == 'tslib_fe') { // Frontend:
$GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row);
} else { // Backend:
t3lib_BEfunc::workspaceOL('sys_template', $row);
}
}
Stefan
Reviews 6
- TYPO3_4-7 11099[BUGFIX] Regression of "better condition in versionOL of t3lib_tstemplate"
- TYPO3_4-5 11097[BUGFIX] Regression of "better condition in versionOL of t3lib_tstemplate"
- TYPO3_4-6 11098[BUGFIX] Regression of "better condition in versionOL of t3lib_tstemplate"
- main 11096[BUGFIX] Regression of "better condition in versionOL of t3lib_tstemplate"
- TYPO3_4-5 7043[BUGFIX] Better condition in versionOL of t3lib_tstemplate
- TYPO3_4-7 11320[BUGFIX] Regression of "better condition in versionOL of t3lib_tstemplate"