|
17 | 17 | use TYPO3\CMS\Core\Database\ConnectionPool; |
18 | 18 | use TYPO3\CMS\Core\Database\RelationHandler; |
19 | 19 | use TYPO3\CMS\Core\Domain\Repository\PageRepository; |
20 | | -use TYPO3\CMS\Core\Information\Typo3Version; |
21 | 20 | use TYPO3\CMS\Core\Resource\FileRepository; |
22 | 21 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
23 | 22 | use TYPO3\CMS\Core\Versioning\VersionState; |
@@ -87,18 +86,14 @@ public function resolveItemsForFrontend(int $uid, string $table = 'tt_content', |
87 | 86 | $pageRepository = GeneralUtility::makeInstance(PageRepository::class); |
88 | 87 | $relationHandler = GeneralUtility::makeInstance(RelationHandler::class); |
89 | 88 | $relationHandler->setWorkspaceId($workspaceId); |
90 | | - if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) { |
91 | | - $additionalWhere = $pageRepository->enableFields(self::TABLE); |
| 89 | + $constraints = $pageRepository->getDefaultConstraints(self::TABLE); |
| 90 | + if ($constraints === []) { |
| 91 | + $additionalWhere = ''; |
92 | 92 | } else { |
93 | | - $constraints = $pageRepository->getDefaultConstraints(self::TABLE); |
94 | | - if ($constraints === []) { |
95 | | - $additionalWhere = ''; |
96 | | - } else { |
97 | | - $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
98 | | - ->getQueryBuilderForTable($table) |
99 | | - ->expr(); |
100 | | - $additionalWhere = ' AND ' . $expressionBuilder->and(...$constraints); |
101 | | - } |
| 93 | + $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 94 | + ->getQueryBuilderForTable($table) |
| 95 | + ->expr(); |
| 96 | + $additionalWhere = ' AND ' . $expressionBuilder->and(...$constraints); |
102 | 97 | } |
103 | 98 | $relationHandler->additionalWhere[self::TABLE] = $additionalWhere; |
104 | 99 | $relationHandler->start( |
|
0 commit comments