Skip to content

Commit

Permalink
Merge pull request #49 from netgen/fix_suggestion_init
Browse files Browse the repository at this point in the history
Fix suggestion init
  • Loading branch information
pspanja authored Oct 20, 2020
2 parents 6014a70 + 6ecf6ff commit d3e1d67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Core/Pagination/Pagerfanta/BaseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ private function setExtraInfo(SearchResult $searchResult)
$this->facets = $searchResult->facets;
$this->maxScore = $searchResult->maxScore;
$this->nbResults = $searchResult->totalCount;
$this->suggestion = $searchResult instanceof ExtraSearchResult ? $searchResult->suggestion : new Suggestion([]);
$this->suggestion = new Suggestion([]);

if ($searchResult instanceof ExtraSearchResult && $searchResult->suggestion instanceof Suggestion) {
$this->suggestion = $searchResult->suggestion;
}

$this->isExtraInfoInitialized = true;
}
Expand Down

0 comments on commit d3e1d67

Please sign in to comment.