From 279d66974dd3d967ba425a6a5a00dca65caa9992 Mon Sep 17 00:00:00 2001 From: Peter Kraume Date: Wed, 8 Nov 2023 22:46:27 +0100 Subject: [PATCH] [BUGFIX] Fix storagePid problem in PostRepository This patch fixes a problem with ignored storagePid if there are multiple blog post plugins on the same page. Only the storagePid setting from the first plugin was evaluated. Fixes #292 --- Classes/Domain/Repository/PostRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/Domain/Repository/PostRepository.php b/Classes/Domain/Repository/PostRepository.php index 84fab51c..032c885d 100644 --- a/Classes/Domain/Repository/PostRepository.php +++ b/Classes/Domain/Repository/PostRepository.php @@ -40,7 +40,6 @@ class PostRepository extends Repository public function initializeObject(): void { $configurationManager = GeneralUtility::makeInstance(ConfigurationManagerInterface::class); - $this->settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'blog'); $querySettings = GeneralUtility::makeInstance( Typo3QuerySettings::class, @@ -414,7 +413,10 @@ public function findRelatedPosts(int $categoryMultiplier = 1, int $tagMultiplier protected function getStoragePidsFromTypoScript(): array { - return GeneralUtility::intExplode(',', $this->settings['persistence']['storagePid']); + $configurationManager = GeneralUtility::makeInstance(ConfigurationManagerInterface::class); + $settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); + + return GeneralUtility::intExplode(',', $settings['persistence']['storagePid']); } /**