mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
$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
This commit is contained in:
parent
f7d106a386
commit
0822578813
1 changed files with 1 additions and 1 deletions
|
@ -632,11 +632,11 @@ class Controller extends Object implements CakeEventListener {
|
||||||
*/
|
*/
|
||||||
public function constructClasses() {
|
public function constructClasses() {
|
||||||
$this->_mergeControllerVars();
|
$this->_mergeControllerVars();
|
||||||
$this->Components->init($this);
|
|
||||||
if ($this->uses) {
|
if ($this->uses) {
|
||||||
$this->uses = (array)$this->uses;
|
$this->uses = (array)$this->uses;
|
||||||
list(, $this->modelClass) = pluginSplit(current($this->uses));
|
list(, $this->modelClass) = pluginSplit(current($this->uses));
|
||||||
}
|
}
|
||||||
|
$this->Components->init($this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue