From 88fbdad2fd6951579971813a6cdd3f67a37e6b79 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 29 Apr 2022 11:29:40 +0800 Subject: [PATCH] * Fix bug#22114. --- module/bug/control.php | 2 +- module/execution/model.php | 1 + module/story/control.php | 4 ++-- module/testcase/control.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index cca97a764f..b10a8b2e4b 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -523,7 +523,7 @@ class bug extends control if($this->app->tab == 'execution' or $this->app->tab == 'project') { $objectID = $this->app->tab == 'project' ? $projectID : $executionID; - $productBranches = $productInfo->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID) : array(); + $productBranches = $productInfo->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); } diff --git a/module/execution/model.php b/module/execution/model.php index 428699a89a..6a1901eba2 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1734,6 +1734,7 @@ class executionModel extends model { foreach($branchPairs as $branchID => $branchName) { + if(strpos($param, 'withMain') !== false and $branchID == BRANCH_MAIN) continue; if(!isset($projectProducts[$productID][$branchID])) unset($branchGroups[$productID][$branchID]); } } diff --git a/module/story/control.php b/module/story/control.php index 4a150cc562..776d2299ae 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -219,7 +219,7 @@ class story extends control $products = $this->product->getProductPairsByProject($objectID, $onlyNoClosed); $productID = empty($productID) ? key($products) : $productID; $product = $this->product->getById(($productID and array_key_exists($productID, $products)) ? $productID : key($products)); - $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID) : array(); + $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); } @@ -502,7 +502,7 @@ class story extends control if($executionID != 0) { - $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $executionID) : array(); + $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $executionID, 'noclosed|withMain') : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); } diff --git a/module/testcase/control.php b/module/testcase/control.php index b986bd54ab..2071f20d2e 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -420,7 +420,7 @@ class testcase extends control if($this->app->tab == 'execution' or $this->app->tab == 'project') { $objectID = $this->app->tab == 'project' ? $this->session->project : $executionID; - $productBranches = (isset($product->type) and $product->type != 'normal') ? $this->execution->getBranchByProduct($productID, $objectID) : array(); + $productBranches = (isset($product->type) and $product->type != 'normal') ? $this->execution->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array(); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); } @@ -594,7 +594,7 @@ class testcase extends control { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); - $productBranches = $this->loadModel('execution')->getBranchByProduct($productID, $this->session->project); + $productBranches = $this->loadModel('execution')->getBranchByProduct($productID, $this->session->project, 'noclosed|withMain'); $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); $branch = key($branches); }