diff --git a/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php b/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php index 2347e70079c8a22a3ca2a077f542aa928b0ae181..01db1b4e07240a6588e84f431e7ce448878f5b37 100644 --- a/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php +++ b/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php @@ -503,7 +503,7 @@ class PageRepository implements LoggerAwareInterface $orderedListByLanguages = array_flip($languageUids); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages'); - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); + $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context)); $result = $queryBuilder->select('*') ->from('pages') ->where( @@ -586,7 +586,7 @@ class PageRepository implements LoggerAwareInterface $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($table); $queryBuilder->setRestrictions( - GeneralUtility::makeInstance(FrontendRestrictionContainer::class) + GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context) ); $olrow = $queryBuilder->select('*') ->from($table) @@ -1172,7 +1172,7 @@ class PageRepository implements LoggerAwareInterface $uid = (int)$uid; if (is_array($GLOBALS['TCA'][$table]) && $uid > 0) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); + $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context)); $row = $queryBuilder->select('*') ->from($table) ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))) @@ -1185,7 +1185,7 @@ class PageRepository implements LoggerAwareInterface if ($checkPage) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('pages'); - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); + $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context)); $numRows = (int)$queryBuilder->count('*') ->from('pages') ->where( @@ -1605,7 +1605,7 @@ class PageRepository implements LoggerAwareInterface // Find pointed-to record. if ($moveID) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); + $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context)); $origRow = $queryBuilder->select(...array_keys($this->purgeComputedProperties($row))) ->from($table) ->where( @@ -1717,7 +1717,7 @@ class PageRepository implements LoggerAwareInterface // If version found, check if it could have been selected with enableFields on // as well: $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); + $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context)); // Remove the frontend workspace restriction because we are testing a version record $queryBuilder->getRestrictions()->removeByType(FrontendWorkspaceRestriction::class); $queryBuilder->select('uid') diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 4f54b91b59005ba458ef3a602a4876e9a2388c0d..64663a7b81748f40d3af53f3f7a12113b9a86be2 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -1162,7 +1162,8 @@ class TypoScriptFrontendController implements LoggerAwareInterface $customContext->setAspect('visibility', GeneralUtility::makeInstance(VisibilityAspect::class)); $pageSelectObject = GeneralUtility::makeInstance(PageRepository::class, $customContext); $targetPage = $pageSelectObject->getWorkspaceVersionOfRecord($this->whichWorkspace(), 'pages', $page['uid']); - $result = $targetPage === -1 || $targetPage === -2; + // Also checks if the workspace version is NOT hidden but the live version is in fact still hidden + $result = $targetPage === -1 || $targetPage === -2 || (is_array($targetPage) && $targetPage['hidden'] == 0 && $page['hidden'] == 1); } else { $result = is_array($page) && ($page['hidden'] || $page['starttime'] > $GLOBALS['SIM_EXEC_TIME'] || $page['endtime'] != 0 && $page['endtime'] <= $GLOBALS['SIM_EXEC_TIME']); }