From 015f9957bed4ca529a7ac854c6bd2441963bfcef Mon Sep 17 00:00:00 2001 From: tigrang Date: Wed, 28 Dec 2011 18:33:01 -0800 Subject: [PATCH] Changed order of controller var merging From AppController -> PluginAppController to PluginAppConroller -> AppController Fixes #2420 Signed-off-by: mark_story --- lib/Cake/Controller/Controller.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index b32e2ba24..61d18585a 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -534,6 +534,18 @@ class Controller extends Object { $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 @@ class Controller extends Object { } $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); - } } /**