Permalink
Browse files

$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
  • Loading branch information...
dereuromark committed May 14, 2013
1 parent f7d106a commit 0822578813d66dfde5fde5a6e988f87f017fc2c9
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Controller.php
@@ -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;
}

0 comments on commit 0822578

Please sign in to comment.