Last active
May 19, 2022 15:29
-
-
Save kitzberger/49d95946f3b8c4536c88fbb76931aa3e to your computer and use it in GitHub Desktop.
Repositories for sys_category don't respect storage pids by default. See https://forge.typo3.org/issues/89295#note-10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Me\MyExtension\Domain\Repository; | |
| use TYPO3\CMS\Extbase\Persistence\Repository; | |
| class CategoryRepository extends Repository | |
| { | |
| public function createQuery() | |
| { | |
| $query = parent::createQuery(); | |
| // This has to be set explicitly to 'true' due to the fact that sys_category | |
| // has rootLevel != 0 in its TCA and hence extbase will set it to 'false'! | |
| // See: extbase/Classes/Persistence/Generic/QueryFactory.php | |
| $query->getQuerySettings()->setRespectStoragePage(true); | |
| return $query; | |
| } | |
| public function findAll() | |
| { | |
| $query = $this->createQuery(); | |
| return $query->execute(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment