Skip to content

Commit

Permalink
Merge pull request #2518 from codeigniter4/pagerurifix
Browse files Browse the repository at this point in the history
Fix pager URI to work in subfolders.
  • Loading branch information
lonnieezell authored Jan 29, 2020
2 parents 2a69569 + 2ec1946 commit add2f5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/Pager/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ protected function ensureGroup(string $group)
}

$this->groups[$group] = [
'uri' => clone Services::request()->uri,
'uri' => clone current_url(true),
'hasMore' => false,
'total' => null,
'perPage' => $this->config->perPage,
Expand All @@ -520,7 +520,7 @@ protected function ensureGroup(string $group)
}

//--------------------------------------------------------------------

/**
* Calculating the current page
*
Expand All @@ -545,7 +545,7 @@ protected function calculateCurrentPage(string $group)

$page = (int) ($_GET[$pageSelector] ?? 1);

$this->groups[$group]['currentPage'] = $page < 1 ? 1 : $page;
$this->groups[$group]['currentPage'] = $page < 1 ? 1 : $page;
}
}

Expand Down
3 changes: 3 additions & 0 deletions tests/system/HTTP/RedirectResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public function testRedirectBackMissing()
}

/**
* @runInSeparateProcess
* @preserveGlobalState disabled
*
* @see https://github.com/codeigniter4/CodeIgniter4/issues/2119
*/
public function testRedirectRouteBaseUrl()
Expand Down
2 changes: 2 additions & 0 deletions tests/system/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
class ResponseTest extends \CIUnitTestCase
{

protected $server;

protected function setUp(): void
{
parent::setUp();
Expand Down

0 comments on commit add2f5f

Please sign in to comment.