Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX:BP:11.5] Do not list cores twice in Index Inspector #3818

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading