From c9288b624fdf226c6570552df8186ab6f249d25b Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 18 Nov 2025 09:55:45 +0800 Subject: [PATCH 1/2] * [bug#67104,done,0.2h,0h] Optimize empty product error. --- module/testtask/ui/create.html.php | 4 ++-- module/testtask/zen.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/testtask/ui/create.html.php b/module/testtask/ui/create.html.php index 3d4cc16a42..3bd0908301 100644 --- a/module/testtask/ui/create.html.php +++ b/module/testtask/ui/create.html.php @@ -30,7 +30,7 @@ formPanel set::label($lang->testtask->product), set::className(!isset($executionID) || !empty($product->shadow) ? 'hidden' : ''), set::name('product'), - set::value($product->id), + set::value($productID), set::control('picker'), set::items($products) ), @@ -65,7 +65,7 @@ formPanel a ( setID('buildCreateLink'), - set('href', createLink('build', 'create', "executionID=$buildExecutionID&productID={$product->id}&projectID={$projectID}")), + set('href', createLink('build', 'create', "executionID=$buildExecutionID&productID={$productID}&projectID={$projectID}")), set('data-toggle', 'modal'), $lang->build->create ) diff --git a/module/testtask/zen.php b/module/testtask/zen.php index a829e01783..9d7124f8d1 100644 --- a/module/testtask/zen.php +++ b/module/testtask/zen.php @@ -403,9 +403,10 @@ class testtaskZen extends testtask /* 如果测试单所属产品在产品键值对中不存在,将其加入。*/ /* Prepare the product key-value pairs. */ $product = $this->loadModel('product')->fetchByID($productID); - if(!isset($this->products[$productID])) $this->products[$productID] = $product->name; + if(!isset($this->products[$productID]) && !empty($product)) $this->products[$productID] = $product->name; $this->view->title = $this->products[$productID] . $this->lang->hyphen . $this->lang->testtask->create; + $this->view->productID = $productID; $this->view->product = $product; $this->view->executions = $productID ? $this->product->getExecutionPairsByProduct($productID, '', $projectID, 'stagefilter') : array(); $this->view->builds = $productID ? $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'notrunk,withexecution', $objectID, $objectType, '', false) : array(); From 9f3dfede5a6e35a8b2c077cd9bc9e2f554b86df1 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 18 Nov 2025 11:02:58 +0800 Subject: [PATCH 2/2] * [bug#67246,done,0.1h,0h] Fix total testtask error. --- module/execution/js/testtask.ui.js | 3 ++- module/project/js/testtask.ui.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/execution/js/testtask.ui.js b/module/execution/js/testtask.ui.js index 1b5f6fc0f3..60084e2dee 100644 --- a/module/execution/js/testtask.ui.js +++ b/module/execution/js/testtask.ui.js @@ -39,8 +39,9 @@ window.setStatistics = function(element, checkedIDList) rows.forEach((row) => { if(checkedIDList.length == 0 || checkedIDList.includes(row.id)) { - const task = row.data; + if(row.id.includes('_')) return; + const task = row.data; if(task.rawStatus == 'wait') { waitCount ++; diff --git a/module/project/js/testtask.ui.js b/module/project/js/testtask.ui.js index 2b0c73611d..cd4bac3a55 100644 --- a/module/project/js/testtask.ui.js +++ b/module/project/js/testtask.ui.js @@ -144,8 +144,9 @@ window.setStatistics = function(element, checkedIDList) rows.forEach((row) => { if(checkedIDList.length == 0 || checkedIDList.includes(row.id)) { - const task = row.data; + if(row.id.includes('_')) return; + const task = row.data; if(task.rawStatus == 'wait') { waitCount ++;