Skip to content

Commit

Permalink
[BUGFIX] Check if collection key exists (#1246)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed Jun 4, 2024
1 parent f7a63eb commit 3a08cab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/ListViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function mainAction(): void

// extract collection(s) from collection parameter
$collections = [];
if ($this->searchParams['collection']) {
if (array_key_exists('collection', $this->searchParams)) {
foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private function addCollectionsQuery(string $query): string
// if collections are given, we prepare the collections query string
// extract collections from collection parameter
$collections = null;
if ($this->searchParams['collection']) {
if (array_key_exists('collection', $this->searchParams)) {
foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
}
Expand Down

0 comments on commit 3a08cab

Please sign in to comment.