[BUGFIX] Fix PHP fatal error in be.tableList view helper 90/26890/2
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 6 Jan 2014 18:03:15 +0000 (19:03 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 16 Jan 2014 22:56:45 +0000 (23:56 +0100)
The be.tableList view helper uses the class localRecordList
which relies on a available $GLOBALS['SOBE']->doc object.
Since https://review.typo3.org/19000/ the doc instance
in SOBE does not get instantiated in any case, which
results in a PHP fatal error using this view helper.

For 6.x this was fixed with https://review.typo3.org/15007/

Fixes: #54748
Releases: 4.7, 4.5
Change-Id: I4ac4a1718ec6c8e0a02723802bf73dbabd1648ab
Reviewed-on: https://review.typo3.org/26890
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php

index 0107299..299145f 100644 (file)
@@ -42,9 +42,10 @@ abstract class Tx_Fluid_ViewHelpers_Be_AbstractBackendViewHelper extends Tx_Flui
                if (!isset($GLOBALS['SOBE']->doc)) {
                        $doc = t3lib_div::makeInstance('template');
                        $doc->backPath = $GLOBALS['BACK_PATH'];
-                       if (is_object($GLOBALS['SOBE'])) {
-                               $GLOBALS['SOBE']->doc = $doc;
+                       if (!isset($GLOBALS['SOBE'])) {
+                               $GLOBALS['SOBE'] = new \stdClass();
                        }
+                       $GLOBALS['SOBE']->doc = $doc;
                } else {
                        $doc = $GLOBALS['SOBE']->doc;
                }