Skip to content

Commit

Permalink
[BUGFIX] Avoid getSolrConfiguration() on null
Browse files Browse the repository at this point in the history
Closes: #3596
Fixes: #3407, #3597
  • Loading branch information
christophlehmann authored and Christoph Lehmann committed Apr 13, 2023
1 parent acb0578 commit 14a0e2f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Classes/IndexQueue/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,20 @@ protected function updateOrAddItemForAllRelatedRootPages(string $itemType, $item
return 0;
}

/* @var SiteRepository $siteRepository */
$siteRepository = GeneralUtility::makeInstance(SiteRepository::class);
foreach ($rootPageIds as $rootPageId) {
$skipInvalidRootPage = $rootPageId === 0;
if ($skipInvalidRootPage) {
continue;
}

/* @var SiteRepository $siteRepository */
$siteRepository = GeneralUtility::makeInstance(SiteRepository::class);
$solrConfiguration = $siteRepository->getSiteByRootPageId($rootPageId)->getSolrConfiguration();
$site = $siteRepository->getSiteByRootPageId($rootPageId);
if ($site === null) {
continue;
}

$solrConfiguration = $site->getSolrConfiguration();
$indexingConfiguration = $this->recordService->getIndexingConfigurationName($itemType, $itemUid, $solrConfiguration);
if ($indexingConfiguration === null) {
continue;
Expand Down

0 comments on commit 14a0e2f

Please sign in to comment.