diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-02 11:50:32 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-02 11:50:32 -0400 |
commit | 853189a43fff8b8b64f18029a35ac910b14932e8 (patch) | |
tree | 53a4b6fd29124de69ce20ea9ec2d0fb7caa1d297 /app/Model | |
parent | 6db72521eab77ebcb5f8bb196fe72e8f4f8a8c34 (diff) |
Do not create empty tags and remove tags only when necessary
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/TaskModificationModel.php | 2 | ||||
-rw-r--r-- | app/Model/TaskTagModel.php | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/app/Model/TaskModificationModel.php b/app/Model/TaskModificationModel.php index 1b176a41..be5f53c8 100644 --- a/app/Model/TaskModificationModel.php +++ b/app/Model/TaskModificationModel.php @@ -108,8 +108,6 @@ class TaskModificationModel extends Base if (isset($values['tags'])) { $this->taskTagModel->save($original_task['project_id'], $values['id'], $values['tags']); unset($values['tags']); - } else { - $this->taskTagModel->save($original_task['project_id'], $values['id'], array()); } } } diff --git a/app/Model/TaskTagModel.php b/app/Model/TaskTagModel.php index 91dfd224..2a08e867 100644 --- a/app/Model/TaskTagModel.php +++ b/app/Model/TaskTagModel.php @@ -82,6 +82,7 @@ class TaskTagModel extends Base public function save($project_id, $task_id, array $tags) { $task_tags = $this->getList($task_id); + $tags = array_filter($tags); return $this->associateTags($project_id, $task_id, $task_tags, $tags) && $this->dissociateTags($task_id, $task_tags, $tags); |