[BUGFIX] Fix using doc instance in be.pageInfoVH
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 29 Apr 2013 07:55:50 +0000 (09:55 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 29 Apr 2013 19:02:24 +0000 (21:02 +0200)
Since the merge of https://review.typo3.org/#/c/19000/
$GLOBALS['SOBE']->doc is not always set. Use the doc
object, which is returned from call $this->getDocInstance instead.

Change-Id: I5d254e115b73a898a12c48ebbe32fb4320934b35
Fixes: #47556
Releases: 4.7, 1.3
Related: #40519
Reviewed-on: https://review.typo3.org/20287
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php

index e2839b3..7762674 100644 (file)
@@ -55,12 +55,12 @@ class Tx_Fluid_ViewHelpers_Be_PageInfoViewHelper extends Tx_Fluid_ViewHelpers_Be
                        $alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
                        $iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
                                // Make Icon:
-                       $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
+                       $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
                } else {        // On root-level of page tree
                                // Make Icon
                        $iconImg = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
                        if($BE_USER->user['admin']) {
-                               $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
+                               $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
                        } else {
                                $theIcon = $iconImg;
                        }