From 877cf930ad0b5c18d7de06c9dcc8a79d4d64bb1e Mon Sep 17 00:00:00 2001 From: phpnut Date: Sun, 23 Dec 2007 06:45:26 +0000 Subject: [PATCH] "Fixes #3748, Auto loading model classes fail in plugins when using $uses in the AppController" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6211 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/controller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 13f8c4394..6f8269d62 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -334,7 +334,11 @@ class Controller extends Object { */ function constructClasses() { if(isset($this->plugin)) { + if(isset($this->uses[0]) && $this->uses[0] === $this->modelClass) { + $this->uses[0] = Inflector::camelize($this->plugin) . '.' . $this->modelClass; + } $appController = Inflector::camelize($this->plugin) . 'AppController'; + if (is_subclass_of($this, $appController)) { $appVars = get_class_vars($appController); $uses = $appVars['uses']; @@ -350,7 +354,6 @@ class Controller extends Object { } } } - } if ($this->uses === null || ($this->uses === array())) {