Skip to content

Commit

Permalink
Fixed a pagination bug
Browse files Browse the repository at this point in the history
Depending on the current page, a page not supposed to show up in the pagination summary can be skipped without returning a null value. It makes it difficult to know it is existent, but just skipped.
  • Loading branch information
carpentiers authored and dhensby committed Dec 19, 2016
1 parent 2918463 commit 222ee6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/PaginatedList.php
Expand Up @@ -293,6 +293,7 @@ public function PaginationSummary($context = 4) {
}

$left = max($current - $offset, 1);
$right = min($current + $offset, $total);
$range = range($current - $offset, $current + $offset);

if ($left + $context > $total) {
Expand All @@ -304,7 +305,7 @@ public function PaginationSummary($context = 4) {
$num = $i + 1;

$emptyRange = $num != 1 && $num != $total && (
$num == $left - 1 || $num == $left + $context + 1
$num == $left - 1 || $num == $right + 1
);

if ($emptyRange) {
Expand Down

0 comments on commit 222ee6b

Please sign in to comment.