Skip to content

Commit

Permalink
Fixing issues caused by not accessing the request object correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 13, 2010
1 parent 18bb5f6 commit 01894b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cake/libs/controller/controller.php
Expand Up @@ -1039,7 +1039,7 @@ public function paginate($object = null, $scope = array(), $whitelist = array())
), E_USER_WARNING);
return array();
}
$options = array_merge($this->request->params, $this->params['url'], $this->passedArgs);
$options = array_merge($this->request->params, $this->request->params['url'], $this->passedArgs);

if (isset($this->paginate[$object->alias])) {
$defaults = $this->paginate[$object->alias];
Expand Down Expand Up @@ -1170,11 +1170,11 @@ public function paginate($object = null, $scope = array(), $whitelist = array())
'defaults' => array_merge(array('limit' => 20, 'step' => 1), $defaults),
'options' => $options
);
if (!isset($this->request['paging'])) {
$this->request['paging'] = array();
if (!isset($this->request->params['paging'])) {
$this->request->params['paging'] = array();
}
$this->request['paging'] = array_merge(
(array)$this->request['paging'],
$this->request->params['paging'] = array_merge(
(array)$this->request->params['paging'],
array($object->alias => $paging)
);

Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/controller/controller.test.php
Expand Up @@ -773,7 +773,7 @@ function testPaginateFieldsDouble(){
'recursive' => -1
);
$conditions = array();
$result = $Controller->paginate('ControllerPost',$conditions);
$result = $Controller->paginate('ControllerPost', $conditions);
$expected = array(
array(
'ControllerPost' => array(
Expand Down

0 comments on commit 01894b3

Please sign in to comment.