Skip to content

Commit

Permalink
[TASK] Detect page routes based on deleted+workspace restriction
Browse files Browse the repository at this point in the history
The Page Router checks for all pages that are available by using
the FrontendRestrictionContainer for database queries.

This leads to side-effects in the future.

Instead, - because all page slugs in one site are unique per
language+workspace - the Page Router should only check
for deleted+current workspace, not wondering about any other
restriction, as this is done when all pages in the rootline are
checked later-on anyway.

This way, frontend previews should be available again.

Resolves: #86037
Releases: master
Change-Id: Ic11a66a958f9391de9084fad86b5d59109bd21c3
Reviewed-on: https://review.typo3.org/58084
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Daniel Sattler <sattler@b13.de>
Tested-by: Daniel Sattler <sattler@b13.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
  • Loading branch information
bmack authored and susannemoog committed Aug 30, 2018
1 parent 6f5d20a commit c9f3867
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions typo3/sysext/core/Classes/Routing/PageRouter.php
Expand Up @@ -24,7 +24,8 @@
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendWorkspaceRestriction;
use TYPO3\CMS\Core\Site\Entity\SiteInterface;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -113,7 +114,10 @@ protected function getPagesFromDatabaseForCandidates(array $slugCandidates, Site
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$queryBuilder
->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
->getRestrictions()
->removeAll()
->add(GeneralUtility::makeInstance(DeletedRestriction::class))
->add(GeneralUtility::makeInstance(FrontendWorkspaceRestriction::class));

$statement = $queryBuilder
->select('uid', 'l10n_parent', 'pid', 'slug')
Expand Down

0 comments on commit c9f3867

Please sign in to comment.