diff --git a/module/execution/model.php b/module/execution/model.php index 1b69ecc997..a77ee4f8ac 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -724,6 +724,9 @@ class executionModel extends model ->checkIF($execution->realBegan != '', 'realBegan', 'le', helper::today()) ->where('id')->eq((int)$executionID) ->exec(); + + /* When it has multiple errors, only the first one is prompted */ + if(dao::isError() and count(dao::$errors['realBegan']) > 1) dao::$errors['realBegan'] = dao::$errors['realBegan'][0]; if(!dao::isError()) return common::createChanges($oldExecution, $execution); } @@ -880,7 +883,10 @@ class executionModel extends model ->checkIF($execution->realEnd != '', 'realEnd', 'ge', $oldExecution->realBegan) ->where('id')->eq((int)$executionID) ->exec(); - + + /* When it has multiple errors, only the first one is prompted */ + if(dao::isError() and count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0]; + if(!dao::isError()) { $this->loadModel('score')->create('execution', 'close', $oldExecution); diff --git a/module/project/model.php b/module/project/model.php index 95759db58d..21a5d7a2e9 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1186,6 +1186,9 @@ class projectModel extends model ->where('id')->eq((int)$projectID) ->exec(); + /* When it has multiple errors, only the first one is prompted */ + if(dao::isError() and count(dao::$errors['realBegan']) > 1) dao::$errors['realBegan'] = dao::$errors['realBegan'][0]; + if(!dao::isError()) return common::createChanges($oldProject, $project); } @@ -1338,6 +1341,9 @@ class projectModel extends model ->where('id')->eq((int)$projectID) ->exec(); + /* When it has multiple errors, only the first one is prompted */ + if(dao::isError() and count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0]; + if(!dao::isError()) { $this->loadModel('score')->create('project', 'close', $oldProject);