Permalink
Browse files

Changed order of controller var merging

From AppController -> PluginAppController to
PluginAppConroller -> AppController

Fixes #2420

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
1 parent 339259c commit 015f9957bed4ca529a7ac854c6bd2441963bfcef @tigrang tigrang committed with markstory Dec 29, 2011
Showing with 12 additions and 12 deletions.
  1. +12 −12 lib/Cake/Controller/Controller.php
@@ -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'];
@@ -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);
- }
}
/**

0 comments on commit 015f995

Please sign in to comment.