Skip to content

Commit

Permalink
Changed order of controller var merging
Browse files Browse the repository at this point in the history
From AppController -> PluginAppController to
PluginAppConroller -> AppController

Fixes #2420

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information
tigrang authored and markstory committed Dec 30, 2011
1 parent 339259c commit 015f995
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/Cake/Controller/Controller.php
Expand Up @@ -534,6 +534,18 @@ protected function _mergeControllerVars() {
$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)) {
$appVars = get_class_vars($this->_mergeParent);
$uses = $appVars['uses'];
Expand All @@ -556,18 +568,6 @@ protected function _mergeControllerVars() {
}
$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);
}
}

/**
Expand Down

0 comments on commit 015f995

Please sign in to comment.