From 46ac0a5e888a765b1361e235fcb1f1ae3bf8ede5 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 22 Nov 2021 08:59:40 +0800 Subject: [PATCH] * Modify the code. --- module/bug/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 0d1d970d54..de663ebc72 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -435,7 +435,7 @@ class bug extends control /* Get product, then set menu. */ $productID = $this->product->saveState($productID, $this->products); $productInfo = $this->product->getById($productID); - $branches = $productInfo->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID, 'active'); + if($branch === '') $branch = (int)$this->cookie->preBranch; /* Init vars. */ @@ -506,7 +506,7 @@ class bug extends control if($this->app->tab == 'execution' or $this->app->tab == 'project') { $objectID = $this->app->tab == 'project' ? $projectID : $executionID; - $productBranches = (isset($productInfo->type) and $productInfo->type != 'normal') ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID) : array(); + $productBranches = $productInfo->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID) : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); }