Fix subfolders caching issue after folder rename (#228)

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-07-29 11:37:29 +02:00
parent b1ab27cbe0
commit fd27a21693

View file

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