Skip to content

Commit

Permalink
fix: Fix SolrPaginator last-page when there are no results
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 14, 2023
1 parent b35e2e6 commit a044446
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/RoadizCoreBundle/src/Api/ListManager/SolrPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function count(): int
public function getLastPage(): float
{
$this->handleOnce();
return $this->listManager->getPageCount() - 1;
$lastPage = $this->listManager->getPageCount() - 1;
return max($lastPage, 1);
}

public function getTotalItems(): float
Expand Down

0 comments on commit a044446

Please sign in to comment.