Skip to content

Commit f67af0d

Browse files
committed
fix: multiple pagers with models do not work
1 parent b306fbc commit f67af0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

system/BaseModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,8 @@ public function errors(bool $forceDB = false)
10731073
*/
10741074
public function paginate(?int $perPage = null, string $group = 'default', ?int $page = null, int $segment = 0)
10751075
{
1076-
$pager = Services::pager(null, null, false);
1076+
// Since multiple models may use the Pager, the Pager must be shared.
1077+
$pager = Services::pager();
10771078

10781079
if ($segment) {
10791080
$pager->setSegment($segment, $group);

0 commit comments

Comments
 (0)