mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Changed order of controller var merging
From AppController -> PluginAppController to PluginAppConroller -> AppController Fixes #2420 Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
parent
339259c841
commit
015f9957be
1 changed files with 12 additions and 12 deletions
|
@ -534,6 +534,18 @@ class Controller extends Object {
|
||||||
$pluginDot = $this->plugin . '.';
|
$pluginDot = $this->plugin . '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pluginController && $this->plugin != null) {
|
||||||
|
$merge = array('components', 'helpers');
|
||||||
|
$appVars = get_class_vars($pluginController);
|
||||||
|
if (
|
||||||
|
($this->uses !== null || $this->uses !== false) &&
|
||||||
|
is_array($this->uses) && !empty($appVars['uses'])
|
||||||
|
) {
|
||||||
|
$this->uses = array_merge($this->uses, array_diff($appVars['uses'], $this->uses));
|
||||||
|
}
|
||||||
|
$this->_mergeVars($merge, $pluginController);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_subclass_of($this, $this->_mergeParent) || !empty($pluginController)) {
|
if (is_subclass_of($this, $this->_mergeParent) || !empty($pluginController)) {
|
||||||
$appVars = get_class_vars($this->_mergeParent);
|
$appVars = get_class_vars($this->_mergeParent);
|
||||||
$uses = $appVars['uses'];
|
$uses = $appVars['uses'];
|
||||||
|
@ -556,18 +568,6 @@ class Controller extends Object {
|
||||||
}
|
}
|
||||||
$this->_mergeVars($merge, $this->_mergeParent, true);
|
$this->_mergeVars($merge, $this->_mergeParent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pluginController && $this->plugin != null) {
|
|
||||||
$merge = array('components', 'helpers');
|
|
||||||
$appVars = get_class_vars($pluginController);
|
|
||||||
if (
|
|
||||||
($this->uses !== null || $this->uses !== false) &&
|
|
||||||
is_array($this->uses) && !empty($appVars['uses'])
|
|
||||||
) {
|
|
||||||
$this->uses = array_merge($this->uses, array_diff($appVars['uses'], $this->uses));
|
|
||||||
}
|
|
||||||
$this->_mergeVars($merge, $pluginController);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue