summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-10-09 11:53:23 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-10-09 11:53:23 (GMT)
commit7d4923848cdf0d14d79dd273a28b2e66a233770c (patch)
treeb8c1bea2f5d292918a2ee8fdb2f151d88b9cff27
parentb72aee51e56792688ad6193e64ff5dd55ab4e5d1 (diff)
downloadroundcubemail-plugins-kolab-7d4923848cdf0d14d79dd273a28b2e66a233770c.tar.gz
Fix moving events to another calendar/folder and reloading it (#3748)
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php2
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache.php7
-rw-r--r--plugins/libkolab/lib/kolab_storage_folder.php5
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php4
4 files changed, 11 insertions, 7 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index f7612f5..80caa9f 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -558,7 +558,7 @@ class kolab_driver extends calendar_driver
return false;
if ($event['_savemode'] != 'new') {
- if (!$fromcalendar->storage->move($event['id'], $storage->get_realname()))
+ if (!$fromcalendar->storage->move($event['id'], $storage->storage))
return false;
$fromcalendar = $storage;
diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
index 42321c5..4a1746b 100644
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -359,11 +359,12 @@ class kolab_storage_cache
*
* @param string Entry's IMAP message UID
* @param string Entry's Object UID
- * @param string Target IMAP folder to move it to
+ * @param object kolab_storage_folder Target storage folder instance
*/
- public function move($msguid, $uid, $target_folder)
+ public function move($msguid, $uid, $target)
{
- $target = kolab_storage::get_folder($target_folder);
+ // clear cached uid mapping and force new lookup
+ unset($target->cache->uid2msg[$uid]);
// resolve new message UID in target folder
if ($new_msguid = $target->cache->uid2msguid($uid)) {
diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php
index df92a6e..e6a0d9e 100644
--- a/plugins/libkolab/lib/kolab_storage_folder.php
+++ b/plugins/libkolab/lib/kolab_storage_folder.php
@@ -933,9 +933,12 @@ class kolab_storage_folder
*/
public function move($uid, $target_folder)
{
+ if (is_string($target_folder))
+ $target_folder = kolab_storage::get_folder($target_folder);
+
if ($msguid = $this->cache->uid2msguid($uid)) {
$this->cache->bypass(true);
- $result = $this->imap->move_message($msguid, $target_folder, $this->name);
+ $result = $this->imap->move_message($msguid, $target_folder->name, $this->name);
$this->cache->bypass(false);
if ($result) {
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 197d17b..acde5be 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -732,7 +732,7 @@ class tasklist_kolab_driver extends tasklist_driver
// moved from another folder
if ($task['_fromlist'] && ($fromfolder = $this->folders[$task['_fromlist']])) {
- if (!$fromfolder->move($task['id'], $folder->name))
+ if (!$fromfolder->move($task['id'], $folder))
return false;
unset($task['_fromlist']);
@@ -785,7 +785,7 @@ class tasklist_kolab_driver extends tasklist_driver
// execute move command
if ($task['_fromlist'] && ($fromfolder = $this->folders[$task['_fromlist']])) {
- return $fromfolder->move($task['id'], $folder->name);
+ return $fromfolder->move($task['id'], $folder);
}
return false;