From c88110d8fc3337d0b61175da2034f4b6435356ce Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 5 Jul 2021 15:49:03 +0800 Subject: [PATCH] * Fix bug #13483. --- module/execution/model.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index b9454ddf2e..506d8355bb 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -594,8 +594,16 @@ class executionModel extends model $nameList[$executionName] = $executionName; /* Check unique code for edited executions. */ - if(isset($codeList[$executionCode])) dao::$errors['code'][] = 'execution#' . $executionID . sprintf($this->lang->error->unique, $this->lang->execution->code, $executionCode); - $codeList[$executionCode] = $executionCode; + if(empty($executionCode)) + { + dao::$errors['code'][] = 'execution#' . $executionID . sprintf($this->lang->error->notempty, $this->lang->project->code); + } + else + { + /* Check unique code for edited executions. */ + if(isset($codeList[$executionCode])) dao::$errors['code'][] = 'execution#' . $executionID . sprintf($this->lang->error->unique, $this->lang->project->code, $executionCode); + $codeList[$executionCode] = $executionCode; + } } if(dao::isError()) die(js::error(dao::getError()));