Skip to content

Commit b5d6a33

Browse files
committed
[WIP] queryBuilder restricionts
1 parent 2c785b4 commit b5d6a33

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

Build/phpstan-baseline-13.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Database\\\\Query\\\\Restriction\\\\FrontendWorkspaceRestriction not found\\.$#"
5-
count: 1
6-
path: ../Classes/Domain/Factory/Database.php
7-
83
-
94
message: "#^Call to protected method getRecordOverlay\\(\\) of class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\Repository\\\\PageRepository\\.$#"
105
count: 1

Classes/Domain/Factory/Database.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,10 @@ public function __construct(Context $context)
4848
protected function getQueryBuilder(): QueryBuilder
4949
{
5050
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
51-
if ($this->getServerRequest() instanceof ServerRequestInterface
52-
&& ApplicationType::fromRequest($this->getServerRequest())->isFrontend()
53-
) {
54-
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
55-
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) {
56-
// do not use FrontendWorkspaceRestriction
57-
$queryBuilder->getRestrictions()
58-
->removeByType(FrontendWorkspaceRestriction::class)
59-
->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId));
60-
}
61-
if ($this->workspaceId > 0) {
62-
$queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class);
63-
}
64-
} else {
65-
$queryBuilder->getRestrictions()
66-
->removeAll()
67-
->add(GeneralUtility::makeInstance(DeletedRestriction::class))
68-
->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId));
69-
}
51+
$queryBuilder->getRestrictions()
52+
->removeAll()
53+
->add(GeneralUtility::makeInstance(DeletedRestriction::class))
54+
->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId));
7055
return $queryBuilder;
7156
}
7257

0 commit comments

Comments
 (0)