From 729324f6e978158df2060660844948d98c67a5db Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Mon, 24 Apr 2023 23:31:39 +0200 Subject: [PATCH] [BUGFIX] Do not list cores twice in Index Inspector In info module cores and connections are listed only once. Resolves: #3616 Ports: #3617 --- .../Backend/Search/InfoModuleController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Classes/Controller/Backend/Search/InfoModuleController.php b/Classes/Controller/Backend/Search/InfoModuleController.php index 695a3eca19..01acdf5c48 100644 --- a/Classes/Controller/Backend/Search/InfoModuleController.php +++ b/Classes/Controller/Backend/Search/InfoModuleController.php @@ -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; @@ -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 = [];