Browse Source

$this->modelClass needs to be correct prior to the components init() call if the component itself accesses the model, lazyloading would try to load the wrong model otherwise

euromark 13 years ago
parent
commit
0822578813
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Controller/Controller.php

+ 1 - 1
lib/Cake/Controller/Controller.php

@@ -632,11 +632,11 @@ class Controller extends Object implements CakeEventListener {
  */
 	public function constructClasses() {
 		$this->_mergeControllerVars();
-		$this->Components->init($this);
 		if ($this->uses) {
 			$this->uses = (array)$this->uses;
 			list(, $this->modelClass) = pluginSplit(current($this->uses));
 		}
+		$this->Components->init($this);
 		return true;
 	}