From 19b8c4ef47f3e856438b4445c2b809a184e22b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Tue, 18 Oct 2022 23:21:20 +0200 Subject: [PATCH] [TASK] Stop injecting query settings (#650) --- CHANGELOG.md | 1 + .../Repository/Traits/StoragePageAgnosticTrait.php | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22a21ba..c87f1d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Drop support for PHP 7.2 and 7.3 (#581) ### Fixed +- Stop injecting QuerySettings (#650) - Do not check `composer.lock` during `composer normalize` (#641) - Require TYPO3 >= 11.5.4 (#643) - Stop relying on transitive dependencies for `psr/http-message` (#613) diff --git a/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php b/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php index f66b11e..70a049a 100644 --- a/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php +++ b/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php @@ -4,24 +4,17 @@ declare(strict_types=1); namespace TTN\Tea\Domain\Repository\Traits; -use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; /** * This trait for repositories makes the repository ignore the storage page setting when fetching models. */ trait StoragePageAgnosticTrait { - private QuerySettingsInterface $querySettings; - - public function injectQuerySettings(QuerySettingsInterface $querySettings): void - { - $this->querySettings = $querySettings; - } - public function initializeObject(): void { - $querySettings = clone $this->querySettings; - + $querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class); $querySettings->setRespectStoragePage(false); $this->setDefaultQuerySettings($querySettings); }