diff --git a/module/product/control.php b/module/product/control.php index 86f7bb4771..5d2d7dc02d 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -169,7 +169,7 @@ class product extends control die(js::locate($this->createLink($this->moduleName, 'browse', "productID=$productID"), 'parent')); } - $this->product->setMenu($this->products, ''); + $this->product->setMenu($this->products, key($this->products)); $this->view->header->title = $this->lang->product->create; $this->view->position[] = $this->view->header->title; diff --git a/module/product/model.php b/module/product/model.php index 0268ec93c3..2534dd8a67 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -25,7 +25,7 @@ class productModel extends model public function setMenu($products, $productID, $extra = '') { /* Has access privilege?. */ - if(!isset($products[$productID]) and !$this->checkPriv($this->getById($productID))) + if($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID))) { echo(js::alert($this->lang->product->accessDenied)); die(js::locate('back')); diff --git a/module/project/control.php b/module/project/control.php index 53d2bdf88b..4495b1db5b 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -526,7 +526,7 @@ class project extends control die(js::locate($this->createLink('project', 'create', "projectID=$projectID"), 'parent')); } - $this->project->setMenu($this->projects, ''); + $this->project->setMenu($this->projects, key($this->projects)); $this->view->header->title = $this->lang->project->create; $this->view->position[] = $this->view->header->title; diff --git a/module/project/model.php b/module/project/model.php index 5ff1e5ab8d..c1ea58cd08 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -66,7 +66,7 @@ class projectModel extends model public function setMenu($projects, $projectID) { /* Check the privilege. */ - if(!isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID))) + if($projects and !isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID))) { echo(js::alert($this->lang->project->accessDenied)); die(js::locate('back'));