Skip to content

Commit

Permalink
Check if collection key exists exists
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Jun 3, 2024
1 parent bff4419 commit 9c949ce
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 @@ -386,7 +386,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 9c949ce

Please sign in to comment.