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 #1

Updated by Steffen Gebert over 11 years ago

  • Category deleted (Backend User Interface)
  • Status changed from New to Accepted

Hi Steffen,

thanks for the snippet.

Even if it's not easily reproducible, the change is pretty easy and safe. Could you please create a patch and push it to the Gerrit review system? See http://wiki.typo3.org/Contribution_Walkthrough_Tutorials

Thanks!
Steffen

Updated by Steffen Hastädt over 11 years ago

Hi Steffen,

here are the patches for version 4.5, 4.6 and 4.7.

Best regards
Steffen

Actions #3

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27446

Actions #4

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27455

Actions #5

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27463

Actions #6

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27463

Actions #7

Updated by Łukasz Jurys about 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF