[BUGFIX] dont set fePreview=2 with ADMCMD_noBeUser 34/27834/5
authorPeter Niederlag <peter.niederlag@typo3.org>
Wed, 19 Feb 2014 16:17:04 +0000 (17:17 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Mon, 1 Jun 2015 12:31:04 +0000 (14:31 +0200)
The workspace preview adds the GET parameter ADMCMD_noBeUser
when requesting the frame for live preview.

$GLOBALS[BE_USER] is unset in index_ts.php when seeing ADMCMD_noBeUser.

In TypoScriptFrontendController fePreview=2 must not be set when
ADMCMD_noBeUser parameter is present to prevent fatal errors on
calling methods on a non-existent $GLOBALS[BE_USER]

Releases: master, 6.2
Resolves: #30643
Change-Id: Idff7febcaaa8b87bd65a993b1860ad378e09b22f
Reviewed-on: http://review.typo3.org/27834
Reviewed-by: Lorenz Ulrich <lorenz.ulrich@visol.ch>
Tested-by: Lorenz Ulrich <lorenz.ulrich@visol.ch>
Reviewed-by: Markus Bucher <markusbucher@gmx.de>
Tested-by: Markus Bucher <markusbucher@gmx.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 2b6e8e1..9d3e0f1 100644 (file)
@@ -1286,7 +1286,7 @@ class TypoScriptFrontendController {
                                }
                        }
                        // The preview flag will be set if a backend user is in an offline workspace
-                       if (($GLOBALS['BE_USER']->user['workspace_preview'] || GeneralUtility::_GP('ADMCMD_view') || $this->doWorkspacePreview()) && ($this->whichWorkspace() === -1 || $this->whichWorkspace() > 0)) {
+                       if (($GLOBALS['BE_USER']->user['workspace_preview'] || GeneralUtility::_GP('ADMCMD_view') || $this->doWorkspacePreview()) && ($this->whichWorkspace() === -1 || $this->whichWorkspace() > 0) && (!GeneralUtility::_GP('ADMCMD_noBeUser'))) {
                                // Will show special preview message.
                                $this->fePreview = 2;
                        }