Skip to content

Commit

Permalink
[BUGFIX] Do not list cores twice in Index Inspector
Browse files Browse the repository at this point in the history
In info module cores and connections are listed only once.

Resolves: #3616
Ports: #3617
  • Loading branch information
christophlehmann authored and dkd-kaehm committed Oct 10, 2023
1 parent a7f7337 commit 729324f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Classes/Controller/Backend/Search/InfoModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ protected function collectConnectionInfos(): void
return;
}

$alreadyListedConnections = [];
foreach ($connections as $connection) {
$coreAdmin = $connection->getAdminService();
$coreUrl = (string)$coreAdmin;
if (in_array($coreUrl, $alreadyListedConnections)) {
continue;
}
$alreadyListedConnections[] = $coreUrl;

if ($coreAdmin->ping()) {
$connectedHosts[] = $coreUrl;
Expand Down Expand Up @@ -218,8 +223,17 @@ protected function collectIndexInspectorInfo(): void
{
$solrCoreConnections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
$documentsByCoreAndType = [];
$alreadyListedCores = [];
foreach ($solrCoreConnections as $languageId => $solrCoreConnection) {
$coreAdmin = $solrCoreConnection->getAdminService();

// Do not list cores twice when multiple languages use the same core
$url = (string)$coreAdmin;
if (in_array($url, $alreadyListedCores)) {
continue;
}
$alreadyListedCores[] = $url;

$documents = $this->apacheSolrDocumentRepository->findByPageIdAndByLanguageId($this->selectedPageUID, $languageId);

$documentsByType = [];
Expand Down

0 comments on commit 729324f

Please sign in to comment.