Fix Paginate |
This code don't work. The segment has a error.
The fix: system\BaseModel.php Before PHP Code: public function paginate(?int $perPage = null, string $group = 'default', ?int $page = null, int $segment = 0) After PHP Code: public function paginate(?int $perPage = null, string $group = 'default', ?int $page = null, int $segment = 0)
How do you raise the error?
I had a problem with the pager, from perhaps a year ago...
I did put a few posts about it on the forum after I was convinced there was a problem, but nobody else seemed to experience it (?). My fix is to change "false" to TRUE in the following line (# 37) in ArrayPaginationModel.php (which I've had to do for every recent revision of CI4, and which still fixes it for me): $pager = \Config\Services::pager(null, null, TRUE); // default was FALSE, but then stops makeLinks working (since it overwrites the call to store()) [NOTE: not sure these comments apply to the last couple of CI4 revisions, but they did at the time]
(02-15-2022, 09:38 PM)kenjis Wrote: How do you raise the error?
I just wanted to know how to reproduce the bug.
Because I was not able to write test code to reproduce the bug. Anyway it already was fixed in the develop branch, and it will be included in v4.2.0.
(02-23-2022, 05:57 PM)kenjis Wrote: I just wanted to know how to reproduce the bug. |
Welcome Guest, Not a member yet? Register Sign In |