Skip to content

Commit

Permalink
[BUGFIX] use FrontendRestrictionContainer for FE Queries
Browse files Browse the repository at this point in the history
Relates to: #8
  • Loading branch information
Achim Fritz committed Jul 12, 2020
1 parent a89e0e7 commit 0c3057f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Domain/Factory/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;


class Database implements SingletonInterface
{

Expand All @@ -29,6 +29,9 @@ protected function getQueryBuilder(): QueryBuilder
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
if (TYPO3_MODE === 'BE') {
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
} else {
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));

}
return $queryBuilder;
}
Expand Down

0 comments on commit 0c3057f

Please sign in to comment.