From 71a2ba3f3da1a7827f136a348ca7e99f15726b36 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 19 Nov 2021 10:11:37 +0800 Subject: [PATCH 1/3] * Fix bug 16411. --- module/build/control.php | 6 +++--- module/build/js/common.js | 2 +- module/project/view/build.html.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index aa1dc47bef..93a637ee03 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -19,7 +19,7 @@ class build extends control * @access public * @return void */ - public function create($executionID = 0, $productID = 0, $projectID = 0) + public function create($executionID = 0, $productID = 0, $projectID = 0, $param = '') { /* Load these models. */ $this->loadModel('execution'); @@ -66,7 +66,7 @@ class build extends control $productGroups = $this->loadModel('product')->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID); - $branchPairs = $this->loadModel('branch')->getPairs($productID); + $branchPairs = $this->loadModel('branch')->getPairs($productID, $param); $branches = array(); $products = array(); @@ -75,7 +75,7 @@ class build extends control { foreach($branchGroups[$productID] as $branchID => $branch) { - $branches[$branchID] = $branchPairs[$branchID]; + if(isset($branchPairs[$branchID])) $branches[$branchID] = $branchPairs[$branchID]; } } diff --git a/module/build/js/common.js b/module/build/js/common.js index 71897d5bdc..e92d9470ad 100644 --- a/module/build/js/common.js +++ b/module/build/js/common.js @@ -16,7 +16,7 @@ function loadBranches(productID) } executionID = $('#execution').val(); - $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=0¶m=&projectID=' + executionID), function(data) + $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=0¶m=active&projectID=' + executionID), function(data) { if(data) { diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index f1c2bf24f9..3834472129 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -31,7 +31,7 @@ execution->byQuery;?>
- " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?> + " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?>
From 029c0e4dca94ee72e03633916a0a7ea9e82d7ce9 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 19 Nov 2021 10:20:58 +0800 Subject: [PATCH 2/3] * Fix bug 16411 --- module/build/control.php | 4 ++-- module/project/view/build.html.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 93a637ee03..b91fedcdda 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -19,7 +19,7 @@ class build extends control * @access public * @return void */ - public function create($executionID = 0, $productID = 0, $projectID = 0, $param = '') + public function create($executionID = 0, $productID = 0, $projectID = 0, $buildActive = '') { /* Load these models. */ $this->loadModel('execution'); @@ -66,7 +66,7 @@ class build extends control $productGroups = $this->loadModel('product')->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID); - $branchPairs = $this->loadModel('branch')->getPairs($productID, $param); + $branchPairs = $this->loadModel('branch')->getPairs($productID, $buildActive); $branches = array(); $products = array(); diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 3834472129..ffe9e032d3 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -31,7 +31,7 @@ execution->byQuery;?>
- " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?> + " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?>
From 0a351a62808f8194f9187fc6af04f612542d0797 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 19 Nov 2021 10:32:37 +0800 Subject: [PATCH 3/3] * Fix bug 16411. --- module/build/control.php | 5 +++-- module/project/view/build.html.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index b91fedcdda..b8a71d0f17 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -16,10 +16,11 @@ class build extends control * * @param int $executionID * @param int $productID + * @param int $projectID * @access public * @return void */ - public function create($executionID = 0, $productID = 0, $projectID = 0, $buildActive = '') + public function create($executionID = 0, $productID = 0, $projectID = 0) { /* Load these models. */ $this->loadModel('execution'); @@ -66,7 +67,7 @@ class build extends control $productGroups = $this->loadModel('product')->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID); - $branchPairs = $this->loadModel('branch')->getPairs($productID, $buildActive); + $branchPairs = $this->loadModel('branch')->getPairs($productID, 'active'); $branches = array(); $products = array(); diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index ffe9e032d3..f1c2bf24f9 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -31,7 +31,7 @@ execution->byQuery;?>
- " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?> + " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?>