diff --git a/module/execution/model.php b/module/execution/model.php index 5d67dddaca..8165caef95 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -429,9 +429,6 @@ class executionModel extends model if($oldExecution->type == 'stage' and $field == 'name') $this->lang->project->name = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->project->name); } - $relatedExecutionsID = $this->getRelatedExecutions($executionID); - $relatedExecutionsID = !empty($relatedExecutionsID) ? implode(',', array_keys($relatedExecutionsID)) : '0'; - /* Update data. */ $this->lang->error->unique = $this->lang->error->repeat; $executionProject = isset($execution->project) ? $execution->project : $oldExecution->project; @@ -441,7 +438,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->checkIF(!empty($execution->name), 'name', 'unique', "id in ($relatedExecutionsID) and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'") + ->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = '$executionProject' and `deleted` = '0'") ->checkFlow() ->where('id')->eq($executionID)