From 0822578813d66dfde5fde5a6e988f87f017fc2c9 Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 14 May 2013 10:17:57 +0200 Subject: [PATCH] $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 --- lib/Cake/Controller/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 834a30ad1..9100dc544 100644 --- a/lib/Cake/Controller/Controller.php +++ b/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; }