Skip to content

Commit

Permalink
[BUGFIX] Fix collection search (#1396)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed Dec 18, 2024
1 parent d0db04e commit eb78cac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Classes/Controller/ListViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function mainAction(): void
$collections = [];
if (is_array($this->searchParams) && array_key_exists('collection', $this->searchParams)) {
foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
if (!empty($collectionEntry)) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ private function addCollectionsQuery(string $query): string
$collections = null;
if (array_key_exists('collection', $this->searchParams)) {
foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
if (!empty($collectionEntry)) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
}
}
}
if ($collections) {
Expand Down

0 comments on commit eb78cac

Please sign in to comment.