Project

General

Profile

Actions

Bug #41593

closed

PHP Fatal error: Call to undefined method stdClass::isAdminPanelVisible()

Added by Steffen Hastädt over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

If no Backend session exists I get this PHP error:

PHP Fatal error: Call to undefined method stdClass::isAdminPanelVisible() in /var/www/.../typo3/sysext/cms/tslib/index_ts.php on line 578

Line 578 in Version 4.5.x
Line 506 in Version 4.6.x
Line 474 in Version 4.7.x

The affected code looks like this:

if (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->beUserLogin) {
    $TSFE->content = str_ireplace('</head>',  $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
    $TSFE->content = str_ireplace('</body>',  $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
}

This is my patch after each TYPO3 Update:

if (is_object($BE_USER) && method_exists($BE_USER, 'isAdminPanelVisible')) {
    if($BE_USER->isAdminPanelVisible() && $TSFE->beUserLogin) {
        $TSFE->content = str_ireplace('</head>',  $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
        $TSFE->content = str_ireplace('</body>',  $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
    }
}

Only one of my 80 installations on the same server is affected and I could not find the reason why only this installation is affected.


Files

41593.4.5.patch (21 KB) 41593.4.5.patch Patch for version 4.5 Steffen Hastädt, 2012-10-17 09:22
41593.4.6.patch (18.4 KB) 41593.4.6.patch Patch for version 4.6 Steffen Hastädt, 2012-10-17 09:22
41593.4.7.patch (17.1 KB) 41593.4.7.patch Patch for version 4.7 Steffen Hastädt, 2012-10-17 09:22
Actions

Also available in: Atom PDF