Skip to content

Commit

Permalink
Merge pull request #5 from webcoast-dk/bugfix/error-in-paginator-with…
Browse files Browse the repository at this point in the history
…-no-results

[BUGFIX] IndexedSearchPaginator: Avoid PHP type error with no results
  • Loading branch information
thommyhh committed Oct 7, 2022
2 parents 94787db + ce01058 commit 3147dba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Backend/IndexedSearchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function ($item) {
$data['categories'][] = [
'configuration' => $indexConfiguration,
'results' => $results['resultRows'],
'paginator' => GeneralUtility::makeInstance(IndexedSearchPaginator::class, $results['resultRows'], $results['count'], $itemsPerPage, $currentPage),
'paginator' => GeneralUtility::makeInstance(IndexedSearchPaginator::class, $results['resultRows'] ?? [], $results['count'] ?? 0, $itemsPerPage, $currentPage),
];
}
} else {
Expand All @@ -78,7 +78,7 @@ function ($item) {
} else {
$results = $this->searchRepository->doSearch($searchWords);
$data['results'] = $results['resultRows'];
$data['paginator'] = GeneralUtility::makeInstance(IndexedSearchPaginator::class, $results['resultRows'], $results['count'], $itemsPerPage, $currentPage);
$data['paginator'] = GeneralUtility::makeInstance(IndexedSearchPaginator::class, $results['resultRows'] ??[], $results['count'] ?? 0, $itemsPerPage, $currentPage);
}

return $data;
Expand Down

0 comments on commit 3147dba

Please sign in to comment.