From 01894b315fde9a2fadcc458e4c4ec9db61ec44a6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 12 Nov 2010 23:14:34 -0500 Subject: [PATCH] Fixing issues caused by not accessing the request object correctly. --- cake/libs/controller/controller.php | 10 +++++----- cake/tests/cases/libs/controller/controller.test.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 775618240..196873dc3 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1039,7 +1039,7 @@ class Controller extends Object { ), 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]; @@ -1170,11 +1170,11 @@ class Controller extends Object { '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) ); diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 489db1fa9..4d4df9fda 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -773,7 +773,7 @@ class ControllerTest extends CakeTestCase { 'recursive' => -1 ); $conditions = array(); - $result = $Controller->paginate('ControllerPost',$conditions); + $result = $Controller->paginate('ControllerPost', $conditions); $expected = array( array( 'ControllerPost' => array(