Skip to content

Commit

Permalink
[BUGFIX:BP:11.5] Avoid getSolrConfiguration() on null
Browse files Browse the repository at this point in the history
  • Loading branch information
christophlehmann authored and dkd-friedrich committed Apr 14, 2023
1 parent e36eae5 commit c566c8e
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 c566c8e

Please sign in to comment.