Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
+ do not load menu params when there is no menu
+ create a new params instance if document params doesn't not exist
  • Loading branch information
lephuongbg committed Sep 19, 2013
1 parent 09a94d6 commit e09ce90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/dz.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . "/";
Expand All @@ -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();
}
Expand Down

0 comments on commit e09ce90

Please sign in to comment.