From e09ce909f0f879762d60caf852715f417fea241a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Ho=C3=A0ng=20Ph=C6=B0=C6=A1ng?= Date: Thu, 19 Sep 2013 11:36:45 +0700 Subject: [PATCH] bug fix + do not load menu params when there is no menu + create a new params instance if document params doesn't not exist --- core/dz.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/dz.class.php b/core/dz.class.php index a9680c1..e39cdf6 100644 --- a/core/dz.class.php +++ b/core/dz.class.php @@ -178,7 +178,7 @@ public function init() $doc = JFactory::getDocument(); $this->document =& $doc; - $this->_working_params = $this->document->params; + $this->_working_params = $this->document->params ? $this->document->params : new JRegistry(); $this->language = $doc->language; $this->session = JFactory::getSession(); $this->baseUrl = JURI::root(true) . "/"; @@ -190,7 +190,8 @@ public function init() // use any menu item level overrides $menus = $app->getMenu(); $menu = $menus->getActive(); - $this->_working_params->merge($menu->params); + if ($menu != null) + $this->_working_params->merge($menu->params); $this->currentMenuItem = ($menu != null && isset($menu->id) ) ? $menu->id : null; $this->currentMenuTree = ($menu != null && isset($menu->tree) ) ? $menu->tree : array(); }