Skip to content

Commit

Permalink
[TASK:T12] DI for IndexQueueWorkerTaskAdditionalFieldProvider::$siteR…
Browse files Browse the repository at this point in the history
…epository

Relates: TYPO3-Solr#3376
  • Loading branch information
dkd-kaehm committed Jun 13, 2023
1 parent 9a72bbc commit 93d7922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 3 additions & 8 deletions Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
}

/**
Expand Down
6 changes: 5 additions & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 93d7922

Please sign in to comment.