From 457dd73ed069125f4f8ff69fbb1c781f00592045 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 3 Dec 2011 14:45:21 -0500 Subject: [PATCH] Move viewVars assignment after callbacks. Assigning the controller viewVars after callbacks allows the controller callbacks to assign additional viewVars, or manipulate existing ones. Fixes #2335 --- lib/Cake/View/Helper/CacheHelper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index 9ddbd225a..642a52df9 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -283,7 +283,7 @@ class CacheHelper extends AppHelper { $controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\')); $controller->layout = $this->layout = \'' . $this->_View->layout. '\'; $controller->theme = $this->theme = \'' . $this->_View->theme . '\'; - $controller->viewVars = $this->viewVars = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->viewVars)) . '\')); + $controller->viewVars = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->viewVars)) . '\')); Router::setRequestInfo($controller->request); $this->request = $request;'; @@ -294,6 +294,7 @@ class CacheHelper extends AppHelper { } $file .= ' + $this->viewVars = $controller->viewVars; $this->loadHelpers(); extract($this->viewVars, EXTR_SKIP); ?>';