[BUGFIX] Workspace page previews collide with generated preview links 32/47132/2
authorOliver Hader <oliver@typo3.org>
Mon, 14 Dec 2015 21:53:55 +0000 (22:53 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 6 Mar 2016 01:45:57 +0000 (02:45 +0100)
Workspace page previews collide with that configuration that might have
been set by using a preview link containing a ADMCMD_prev command. The
keyword "IGNORE" is introduced to actually ignore these configurations
when viewing a page from the workspace module.

Resolves: #72225
Releases: master, 7.6, 6.2
Change-Id: I6a73e860a76308028f0a3b1bcd182e41082adcd6
Reviewed-on: https://review.typo3.org/47132
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/version/Classes/Hook/PreviewHook.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php

index c862669..7b452f6 100644 (file)
@@ -152,8 +152,8 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
     public function getPreviewConfiguration()
     {
         $inputCode = $this->getPreviewInputCode();
-        // If inputcode is available, look up the settings
-        if ($inputCode) {
+        // If input code is available and shall not be ignored, look up the settings
+        if ($inputCode && $inputCode !== 'IGNORE') {
             // "log out"
             if ($inputCode == 'LOGOUT') {
                 setcookie($this->previewKey, '', 0, GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'));
index e9a5bc6..7a3d1e2 100644 (file)
@@ -138,11 +138,11 @@ class PreviewController extends AbstractController
         if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {
             $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), \TYPO3\CMS\Workspaces\Controller\PreviewController::class, 'workspaces', 'web_workspacesworkspaces');
             $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
-            $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
+            $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams . '&ADMCMD_prev=IGNORE');
         } else {
-            $this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1');
+            $this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1&ADMCMD_prev=IGNORE');
         }
-        $this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace);
+        $this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_prev=IGNORE&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace);
         $this->view->assign('wsSettingsUrl', $wsSettingsUrl);
         $this->view->assign('backendDomain', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
         $splitPreviewTsConfig = BackendUtility::getModTSconfig($this->pageId, 'workspaces.splitPreviewModes');