From 9621a762f1a7a83e076fa0284f515f0b8ef4e77c Mon Sep 17 00:00:00 2001 From: sunjun Date: Mon, 14 Mar 2022 11:05:55 +0800 Subject: [PATCH] fixbug #50431 --- module/execution/model.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index f9c191215c..e0b94d1ed9 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -448,18 +448,12 @@ class executionModel extends model } $products = array_filter($this->post->products); - if($oldExecution->type == 'stage'|| $oldExecution->type == 'sprint' and empty($products)) + $noLink = $oldExecution->type != 'kanban' ? $this->lang->execution->noLinkProduct : $this->lang->execution->kanbanNoLinkProduct; + if(empty($products)) { - dao::$errors['message'][] = $this->lang->execution->noLinkProduct; + dao::$errors['message'][] =$noLink; return false; } - - if($oldExecution->type == 'kanban' and empty($products)) - { - dao::$errors['message'][] = $this->lang->execution->kanbanNoLinkProduct; - return false; - } - /* Get the data from the post. */ $execution = fixer::input('post') ->setDefault('lastEditedBy', $this->app->user->account)