Skip to content

Commit

Permalink
$this->modelClass needs to be correct prior to the components init() …
Browse files Browse the repository at this point in the history
…call if the component itself accesses the model, lazyloading would try to load the wrong model otherwise
  • Loading branch information
euromark committed May 14, 2013
1 parent f7d106a commit 0822578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Controller.php
Expand Up @@ -632,11 +632,11 @@ public function implementedEvents() {
*/
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;
}

Expand Down

0 comments on commit 0822578

Please sign in to comment.