From 099f5b920082022dc8b1856ce679b82f7dcb95f3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 22 Dec 2023 16:29:27 +0800 Subject: [PATCH] * Fix bug #41720. --- module/execution/js/batchedit.ui.js | 13 +++++++------ module/execution/model.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/execution/js/batchedit.ui.js b/module/execution/js/batchedit.ui.js index 4e7835e382..e736c04d9a 100644 --- a/module/execution/js/batchedit.ui.js +++ b/module/execution/js/batchedit.ui.js @@ -3,14 +3,15 @@ window.renderRowData = function($row, index, row) if(row.type == 'stage') { /* If is stage, modify lifetime to attribute. */ - let $attribute = $row.find('.form-batch-input[data-name="lifetime"]').empty(); - let name = $attribute.attr('name'); - $attribute.attr('name', name.replace('lifetime', 'attribute')); - for(let key in stageList) + let stageItems = []; + for(let key in stageList) stageItems.push({value: key, text: stageList[key]}); + + $row.find('[data-name="lifetime"]').find('.picker-box').on('inited', function(e, info) { - $attribute.append(''); - } + let $attribute = info[0]; + $attribute.render({items: stageItems, required: true, name: 'attribute'}); + }); } $row.find('[data-name="lifetime"]').find('.picker-box').on('inited', function(e, info) diff --git a/module/execution/model.php b/module/execution/model.php index a28fc66b33..b892bfc4f5 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -560,7 +560,7 @@ class executionModel extends model if(isset($postData->attribute) && isset($project->model) && in_array($project->model, array('waterfall', 'waterfallplus'))) { $this->app->loadLang('stage'); - $attribute = $executions[$executionID]->attribute; + $attribute = isset($executions[$executionID]->attribute) ? $executions[$executionID]->attribute : $oldExecution->attribute; if(isset($attributeList[$parentID])) {