Skip to content

Commit 8dcf489

Browse files
committed
update Services::pager() to use pull Pager Config by config("Pager") as well if no config passed
1 parent b0705ba commit 8dcf489

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

system/Config/Services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ public static function pager($config = null, RendererInterface $view = null, boo
500500

501501
if (empty($config))
502502
{
503-
$config = new \Config\Pager();
503+
$config = config('Pager');
504504
}
505505

506506
if (! $view instanceof RendererInterface)

tests/system/Database/Live/ModelTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,19 +1345,13 @@ public function testPaginateChangeConfigPager()
13451345
$perPage = config('Pager')->perPage;
13461346
config('Pager')->perPage = 1;
13471347

1348-
// ensure new instance for new "perPage" config from config('Pager')
1349-
\Config\Services::pager(config('Pager'), null, true);
1350-
13511348
$model = new ValidModel($this->db);
13521349

13531350
$data = $model->paginate();
13541351

13551352
$this->assertEquals(1, count($data));
13561353

13571354
config('Pager')->perPage = $perPage;
1358-
1359-
// rollback to use same instance on call
1360-
\Config\Services::pager(config('Pager'), null, false);
13611355
}
13621356

13631357
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)