Merge pull request #1209 from SamBrishes/patch-007
Bugfix: Search Plugin will not work if itemsPerPage is set to "All Content"
This commit is contained in:
commit
f9c0105168
1 changed files with 9 additions and 3 deletions
|
@ -131,9 +131,15 @@ EOF;
|
||||||
// The first page number is 1, so the real is 0
|
// The first page number is 1, so the real is 0
|
||||||
$realPageNumber = $url->pageNumber() - 1;
|
$realPageNumber = $url->pageNumber() - 1;
|
||||||
$itemsPerPage = $site->itemsPerPage();
|
$itemsPerPage = $site->itemsPerPage();
|
||||||
$chunks = array_chunk($list, $itemsPerPage);
|
if($itemsPerPage <= 0) {
|
||||||
if (isset($chunks[$realPageNumber])) {
|
if($realPageNumber === 0) {
|
||||||
$this->pagesFound = $chunks[$realPageNumber];
|
$this->pagesFound = $list;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$chunks = array_chunk($list, $itemsPerPage);
|
||||||
|
if (isset($chunks[$realPageNumber])) {
|
||||||
|
$this->pagesFound = $chunks[$realPageNumber];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue