From cc49cbe4396fd3183a39c5b6b19b26460d0927ee Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 14 Jun 2022 06:03:55 +0000 Subject: [PATCH] * Finish task#57156 --- framework/router.class.php | 2 ++ module/custom/control.php | 2 ++ module/custom/lang/en.php | 1 + module/custom/lang/zh-cn.php | 1 + 4 files changed, 6 insertions(+) diff --git a/framework/router.class.php b/framework/router.class.php index 8012024df6..f4d2bc9545 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -119,6 +119,8 @@ class router extends baseRouter if(isset($nullKey))$lang->{$moduleName}->{$section}[$nullKey] = $nullValue; foreach($fields as $key => $value) { + if($section == 'priList' and $key > 0 and $value === '') continue; // Fix bug #23538. + if(!isset($lang->{$moduleName})) $lang->{$moduleName} = new stdclass(); if(!isset($lang->{$moduleName}->{$section})) $lang->{$moduleName}->{$section} = array(); $lang->{$moduleName}->{$section}[$key] = $value; diff --git a/module/custom/control.php b/module/custom/control.php index 46ac68f510..68327343fc 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -236,6 +236,8 @@ class custom extends control $value = $data->values[$index]; $system = $data->systems[$index]; + if($key and $value === '') return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->valueEmpty)); // Fix bug #23538. + $this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value); } } diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 257bbdc8b8..2e2d5ea07a 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -183,6 +183,7 @@ $lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on $lang->custom->notice->readOnlyOfExecution = "If Change Forbidden, any change on tasks, builds, efforts and stories of the closed {$lang->executionCommon} is also forbidden."; $lang->custom->notice->readOnlyOfKanban = "If Change Forbidden, any change on kanban card and related operations of {$lang->custom->kanban} is also forbidden."; $lang->custom->notice->URSREmpty = 'Custom requirement name can not be empty!'; +$lang->custom->notice->valueEmpty = 'Value can not be empty!'; $lang->custom->notice->confirmDelete = 'Are you sure you want to delete it?'; $lang->custom->notice->confirmReviewCase = 'Set the case in Wait to Normal?'; $lang->custom->notice->storyReviewTip = 'After selecting by individual, position, and department, take the union of these three filters. '; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index c4142d8e76..57813b16e2 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -183,6 +183,7 @@ $lang->custom->notice->readOnlyOfProduct = '禁止修改后,已关闭' . $la $lang->custom->notice->readOnlyOfExecution = "禁止修改后,已关闭{$lang->custom->execution}下的任务、版本、日志以及关联需求都禁止修改。"; $lang->custom->notice->readOnlyOfKanban = "禁止修改后,已关闭{$lang->custom->kanban}下的卡片以及相关设置都禁止修改。"; $lang->custom->notice->URSREmpty = '自定义需求名称不能为空!'; +$lang->custom->notice->valueEmpty = '值不能为空!'; $lang->custom->notice->confirmDelete = '您确定要删除吗?'; $lang->custom->notice->confirmReviewCase = '是否将待评审的用例修改为正常状态?'; $lang->custom->notice->storyReviewTip = '按人员、职位、部门勾选后,取所有人员的并集。';