summaryrefslogtreecommitdiff
path: root/app/Model/TaskModification.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-17 14:56:31 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-17 14:56:31 -0500
commite94c4cab7f79657f8b514b4af6c4e459e9b42961 (patch)
tree4986bdff7f1b1b401ff819642a1bab8d1d1c9a39 /app/Model/TaskModification.php
parent1259e911e4316f9f1ae401f4f293da69d9ba9e78 (diff)
Avoid automatic actions that change the color to fire subsequent events
Diffstat (limited to 'app/Model/TaskModification.php')
-rw-r--r--app/Model/TaskModification.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/Model/TaskModification.php b/app/Model/TaskModification.php
index 781646b8..5f0fd074 100644
--- a/app/Model/TaskModification.php
+++ b/app/Model/TaskModification.php
@@ -17,16 +17,17 @@ class TaskModification extends Base
*
* @access public
* @param array $values
+ * @param boolean $fire_events
* @return boolean
*/
- public function update(array $values)
+ public function update(array $values, $fire_events = true)
{
$original_task = $this->taskFinder->getById($values['id']);
$this->prepare($values);
$result = $this->db->table(Task::TABLE)->eq('id', $original_task['id'])->update($values);
- if ($result) {
+ if ($fire_events && $result) {
$this->fireEvents($original_task, $values);
}
@@ -57,7 +58,8 @@ class TaskModification extends Base
}
foreach ($events as $event) {
- $this->container['dispatcher']->dispatch($event, new TaskEvent($event_data));
+ $this->logger->debug('Event fired: '.$event);
+ $this->dispatcher->dispatch($event, new TaskEvent($event_data));
}
}