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..befa04ed22 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