From 6f8465e9a84b6e57e20c210e4d11d3c0d5d24b4c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 25 Feb 2016 19:33:59 +0100 Subject: [PATCH] Fix duplicated event after editing an event with tasklist change (#5302) --- plugins/tasklist/tasklist.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php index 6b43e167..9e0b3a41 100644 --- a/plugins/tasklist/tasklist.php +++ b/plugins/tasklist/tasklist.php @@ -252,12 +252,16 @@ class tasklist extends rcube_plugin $rec = $this->prepare_task($rec); $clone = $this->handle_recurrence($rec, $this->driver->get_task($rec)); if ($success = $this->driver->edit_task($rec)) { - $refresh[] = $this->driver->get_task($rec); + $new_task = $this->driver->get_task($rec); + $new_task['tempid'] = $rec['id']; + $refresh[] = $new_task; $this->cleanup_task($rec); // add clone from recurring task if ($clone && $this->driver->create_task($clone)) { - $refresh[] = $this->driver->get_task($clone); + $new_clone = $this->driver->get_task($clone); + $new_clone['tempid'] = $clone['id']; + $refresh[] = $new_clone; $this->driver->clear_alarms($rec['id']); } @@ -268,6 +272,7 @@ class tasklist extends rcube_plugin if ($this->driver->move_task($child)) { $r = $this->driver->get_task($child); if ((bool)($filter & self::FILTER_MASK_COMPLETE) == $this->driver->is_complete($r)) { + $r['tempid'] = $cid; $refresh[] = $r; } }