Skip to content

Commit a7710b4

Browse files
author
Marvin Kuhn
authored
fixed: last next link isnt n+1 now
1 parent 5b8ef19 commit a7710b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Classes/Fusion/PaginationArrayImplementation.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ public function evaluate()
147147
$pageArray = $this->addItemToTheStartOfPageArray($pageArray, $this->currentPage - 1, 'previous');
148148
}
149149
if ($this->lastPage < $this->numberOfPages || $this->paginationConfig['alwaysShowNextAndPrevious']) {
150-
$pageArray = $this->addItemToTheEndOfPageArray($pageArray, $this->currentPage + 1, 'next');
150+
if($this->currentPage < $this->numberOfPages) {
151+
$pageArray = $this->addItemToTheEndOfPageArray($pageArray, $this->currentPage + 1, 'next');
152+
} else {
153+
$pageArray = $this->addItemToTheEndOfPageArray($pageArray, $this->currentPage, 'next');
154+
}
151155
}
152156
}
153157
if ($this->paginationConfig['showFirstAndLast']) {

0 commit comments

Comments
 (0)