From 2e17074dc75ccf3b3b901d97290ba5cc395fb7dc Mon Sep 17 00:00:00 2001 From: ojtibi Date: Thu, 7 Jul 2011 14:16:19 +0800 Subject: [PATCH] Fixed model aliases for custom pagination. Proper keys have been added to $this->paginate and the $conditions array for this controller to work in a subclass. --- controllers/users_controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/users_controller.php b/controllers/users_controller.php index 7d431718e..b681b7c0a 100644 --- a/controllers/users_controller.php +++ b/controllers/users_controller.php @@ -89,7 +89,7 @@ public function index() { $this->data[$this->modelClass]['search'] = $searchTerm; } - $this->paginate = array( + $this->paginate[$this->modelClass] = array( 'search', 'limit' => 12, 'order' => $this->modelClass . '.username ASC', @@ -97,8 +97,8 @@ public function index() { 'conditions' => array( 'OR' => array( 'AND' => array( - $this->modelClass . '.active' => 1, - $this->modelClass . '.email_authenticated' => 1)))); + $this->{$this->modelClass}->alias . '.active' => 1, + $this->{$this->modelClass}->alias . '.email_authenticated' => 1)))); $this->set('users', $this->paginate($this->modelClass));