diff --git a/module/task/control.php b/module/task/control.php index a7a5c7a261..3ef25d391b 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1020,9 +1020,10 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->close($taskID); + if(dao::isError()) die(js::error(dao::getError())); - if($this->post->comment != '' or !empty($changes)) + if(!empty($changes)) { $actionID = $this->action->create('task', $taskID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); diff --git a/module/task/model.php b/module/task/model.php index 9574e430b6..125266e7d6 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1679,6 +1679,7 @@ class taskModel extends model public function close($taskID) { $oldTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch(); + if($oldTask->status == 'closed') return; $now = helper::now(); $task = fixer::input('post')