Fixed a pagination bug

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.
This commit is contained in:
PingMetal 2016-12-18 05:13:58 -05:00 committed by Daniel Hensby
parent 2918463619
commit 222ee6bde2
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -293,6 +293,7 @@ class PaginatedList extends SS_ListDecorator {
}
$left = max($current - $offset, 1);
$right = min($current + $offset, $total);
$range = range($current - $offset, $current + $offset);
if ($left + $context > $total) {
@ -304,7 +305,7 @@ class PaginatedList extends SS_ListDecorator {
$num = $i + 1;
$emptyRange = $num != 1 && $num != $total && (
$num == $left - 1 || $num == $left + $context + 1
$num == $left - 1 || $num == $right + 1
);
if ($emptyRange) {