"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
This commit is contained in:
phpnut 2007-12-23 06:45:26 +00:00
parent 27721cb730
commit 877cf930ad

View file

@ -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())) {