[BUGFIX] Take versioned record into account for showHidden flag.
authorSteffen Ritter <info@rs-websystems.de>
Wed, 5 Sep 2012 06:21:30 +0000 (08:21 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 5 Sep 2012 06:29:34 +0000 (08:29 +0200)
FollowUp to issue #33392 in master - the merged condition
in if always results to true --> every page is considered
as workspace spage. This results in a broken preview
functionality for normal live pages.

Should be integrated in 4.7, 4.6 and 4.5 directly when
backporting the original issue.

Change-Id: Ibe57c575020caf0184ddce54744f52b176027d7a
Fixes: #33392
Releases: 6.0
Reviewed-on: http://review.typo3.org/14357
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index e237d54..73b08d5 100644 (file)
@@ -1246,7 +1246,7 @@ class TypoScriptFrontendController {
                $pageSelectCondition = ($field . '=') . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, 'pages');
                $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,hidden,starttime,endtime', 'pages', $pageSelectCondition . ' AND pid>=0 AND deleted=0');
                $workspace = $this->whichWorkspace();
-               if ($workspace !== 0 || $workspace !== FALSE) {
+               if ($workspace !== 0 && $workspace !== FALSE) {
                        // Fetch overlay of page if in workspace and check if it is hidden
                        $pageSelectObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
                        $pageSelectObject->versioningPreview = TRUE;