Fix subfolders caching issue after folder rename (#228)
This commit is contained in:
parent
b1ab27cbe0
commit
fd27a21693
1 changed files with 12 additions and 9 deletions
|
@ -290,20 +290,23 @@ class rcube_kolab
|
||||||
$folder = $kolab->getFolder($oldname);
|
$folder = $kolab->getFolder($oldname);
|
||||||
$folder->setFolder($newname);
|
$folder->setFolder($newname);
|
||||||
|
|
||||||
// We're not using $folder->save() because some caching issues
|
|
||||||
$result = $kolab->rename($folder);
|
$result = $kolab->rename($folder);
|
||||||
|
|
||||||
if (is_a($result, 'PEAR_Error')) {
|
if (is_a($result, 'PEAR_Error')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// need to re-set some properties
|
// @TODO: Horde doesn't update subfolders cache nor subscriptions
|
||||||
$folder->name = $folder->new_name;
|
// but we cannot use Roundcube imap object here, because
|
||||||
$folder->new_name = null;
|
// when two connections are used in one request and we have
|
||||||
$folder->_title = null;
|
// multi-server configuration, updating the cache after all
|
||||||
$folder->_owner = null;
|
// would get wrong information (e.g. annotations)
|
||||||
// resetting _data prevents from some wierd cache unserialization issue
|
|
||||||
$folder->_data = null;
|
// Reset the List object and cache
|
||||||
|
$kolab = null;
|
||||||
|
if (self::$cache) {
|
||||||
|
self::$list = null;
|
||||||
|
self::$cache->remove('mailboxes', true);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue