From 06ff4a54932b0a8fb7fbab1adcc355ed6bad5f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Thu, 1 Jun 2023 11:02:10 +0200 Subject: [PATCH] [TASK:T12] DI for IndexQueueWorkerTaskAdditionalFieldProvider::$siteRepository Relates: #3376 --- .../IndexQueueWorkerTaskAdditionalFieldProvider.php | 11 +++-------- Configuration/Services.yaml | 6 +++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php b/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php index 90438678e0..0a83e59b9a 100644 --- a/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php +++ b/Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php @@ -35,14 +35,9 @@ */ class IndexQueueWorkerTaskAdditionalFieldProvider extends AbstractAdditionalFieldProvider { - /** - * SiteRepository - */ - protected SiteRepository $siteRepository; - - public function __construct() - { - $this->siteRepository = GeneralUtility::makeInstance(SiteRepository::class); + public function __construct( + protected readonly SiteRepository $siteRepository + ) { } /** diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index ad545a02af..f31ff72c69 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -49,7 +49,7 @@ services: event: TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent # END: BE modules - viewhelper_backend: + viewhelpers_backend: namespace: ApacheSolrForTypo3\Solr\ViewHelpers\Backend\ resource: '../Classes/ViewHelpers/Backend/*' public: true @@ -267,6 +267,10 @@ services: tags: - name: event.listener identifier: 'solr.index.FrontendHelper.PageIndexer.indexPageContentAfterCacheableContentIsGenerated' + ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTaskAdditionalFieldProvider: + public: true + arguments: + $siteRepository: '@ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository' ApacheSolrForTypo3\Solr\EventListener\PageIndexer\AdditionalFieldsForPageIndexing: autowire: true