diff --git a/src/View/Helper/PaginatorHelper.php b/src/View/Helper/PaginatorHelper.php index a48b568fd1c..d9eb4c468fd 100644 --- a/src/View/Helper/PaginatorHelper.php +++ b/src/View/Helper/PaginatorHelper.php @@ -85,6 +85,15 @@ class PaginatorHelper extends Helper { public function __construct(View $View, array $config = array()) { parent::__construct($View, $config); + $this->setUpUrl(); + } + +/** + * Merges passed args with URL options. + * + * @return void + */ + public function setUpUrl() { $this->config( 'options.url', array_merge($this->request->params['pass'], $this->request->query) diff --git a/tests/TestCase/View/Helper/PaginatorHelperTest.php b/tests/TestCase/View/Helper/PaginatorHelperTest.php index 543fa698d9c..f6b2e5d9679 100644 --- a/tests/TestCase/View/Helper/PaginatorHelperTest.php +++ b/tests/TestCase/View/Helper/PaginatorHelperTest.php @@ -739,7 +739,7 @@ public function testPassedArgsMergingWithUrlOptions() { $this->Paginator->request->params['pass'] = array(2); $this->Paginator->request->query = array('page' => 1, 'foo' => 'bar', 'x' => 'y'); - $this->Paginator->__construct($this->View); + $this->Paginator->setUpUrl(); $result = $this->Paginator->sort('title'); $expected = array(