diff --git a/module/bug/control.php b/module/bug/control.php index 4e2979347e..42a3d8e425 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -559,7 +559,7 @@ class bug extends control if($user) $productMembers[$assignedTo] = $user->realname; } - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !in_array($branch, array_keys($branches))) ? 0 : $branch); + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); /* Get products and projects. */ diff --git a/module/testcase/control.php b/module/testcase/control.php index 983ec22947..2022e9fdde 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -491,7 +491,7 @@ class testcase extends control $this->view->executionID = $executionID; $this->view->productInfo = $productInfo; $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, ($branch === 'all' or !in_array($branch, array_keys($branches))) ? 0 : $branch); + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); $this->view->currentModuleID = $currentModuleID; $this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('testcase', 'browse', "productID=$productID") : ''; $this->view->stories = $stories;