From 0f8e1500deee08a5a923ec30f680a822650166f7 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 11 Jan 2012 20:21:56 -0500 Subject: [PATCH] Ensure helpers are loaded in data views. Both XmlView and JsonView should load helpers when they use view files. Fixes #2465 --- lib/Cake/View/JsonView.php | 3 +++ lib/Cake/View/XmlView.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/Cake/View/JsonView.php b/lib/Cake/View/JsonView.php index f057f08c9..66613a2c1 100644 --- a/lib/Cake/View/JsonView.php +++ b/lib/Cake/View/JsonView.php @@ -96,6 +96,9 @@ class JsonView extends View { return $content; } if ($view !== false && $viewFileName = $this->_getViewFileName($view)) { + if (!$this->_helpersLoaded) { + $this->loadHelpers(); + } $content = $this->_render($viewFileName); $this->Blocks->set('content', $content); return $content; diff --git a/lib/Cake/View/XmlView.php b/lib/Cake/View/XmlView.php index 9eea5e5ee..8d88a810f 100644 --- a/lib/Cake/View/XmlView.php +++ b/lib/Cake/View/XmlView.php @@ -99,6 +99,9 @@ class XmlView extends View { return $content; } if ($view !== false && $viewFileName = $this->_getViewFileName($view)) { + if (!$this->_helpersLoaded) { + $this->loadHelpers(); + } $content = $this->_render($viewFileName); $this->Blocks->set('content', (string)$content); return $content;