From 549290cf9d5d824201d893c9d4cb63ea171950b0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 11 Nov 2022 17:35:34 +0800 Subject: [PATCH] * fix bug for create project release. --- module/projectrelease/control.php | 2 +- module/projectrelease/js/create.js | 3 ++- module/projectrelease/view/create.html.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index a16c1aa687..616a6acfbf 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -49,7 +49,7 @@ class projectrelease extends control $this->view->products = $this->products; $this->view->product = $product; - $this->view->branches = (isset($product->type) and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID, 'active'); + $this->view->branches = (isset($product->type) and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID, 'active', $projectID); $this->view->branch = $branch; $this->view->project = $this->project->getByID($projectID); } diff --git a/module/projectrelease/js/create.js b/module/projectrelease/js/create.js index 36e9089d4b..e04f96c37c 100644 --- a/module/projectrelease/js/create.js +++ b/module/projectrelease/js/create.js @@ -45,9 +45,10 @@ function loadBranches(productID) if(data) { $inputGroup.append(data); + $inputGroup.find('#branch').attr('onchange', 'loadBuilds()'); $('#branch').css('width', '120px').chosen(); - loadBuilds(); } + loadBuilds(); $inputGroup.fixInputGroup(); }) } diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php index 8477a26cfd..ea809f9afe 100644 --- a/module/projectrelease/view/create.html.php +++ b/module/projectrelease/view/create.html.php @@ -38,7 +38,7 @@
id, "onchange='loadBranches(this.value)' class='form-control chosen'");?> - type != 'normal') echo html::select('branch', $branches, $branch, "class='form-control chosen control-branch' onchange='loadBuilds()'");?> + type != 'normal') echo html::select('branch', $branches, $branch, "class='form-control chosen control-branch'");?>