From c5de2871714cdd7006109fd4b9e605c3592c5106 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 22 Nov 2021 09:32:13 +0800 Subject: [PATCH] * Fix bug #16502. --- module/testcase/control.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 1ef99605cf..fc3180d901 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -571,6 +571,20 @@ class testcase extends control $showFields = str_replace(array(0 => ",branch,", 1 => ",platform,"), '', ",$showFields,"); $showFields = trim($showFields, ','); } + + if($this->app->tab == 'project' and $product->type != 'normal') + { + $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + + $productBranches = $this->loadModel('execution')->getBranchByProduct($productID, $this->session->project); + $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); + $branch = key($branches); + } + else + { + $branches = $this->loadModel('branch')->getPairs($productID, 'active'); + } + $this->view->customFields = $customFields; $this->view->showFields = $showFields; @@ -586,7 +600,7 @@ class testcase extends control $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->currentModuleID = $currentModuleID; $this->view->branch = $branch; - $this->view->branches = $this->loadModel('branch')->getPairs($productID, 'active'); + $this->view->branches = $branches; $this->view->needReview = $this->testcase->forceNotReview() == true ? 0 : 1; $this->display();