From d08cb11137116a7f3a98adb48750b6edccf68abe Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 15 May 2012 13:57:27 +0200 Subject: [PATCH] Fixed working with disabled kolab_cache --- plugins/libkolab/lib/kolab_storage_cache.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php index 9f9431c6..19a48157 100644 --- a/plugins/libkolab/lib/kolab_storage_cache.php +++ b/plugins/libkolab/lib/kolab_storage_cache.php @@ -82,7 +82,8 @@ class kolab_storage_cache return; // lock synchronization for this folder or wait if locked - $this->_sync_lock(); + if (!$this->_sync_lock()) + return; // synchronize IMAP mailbox cache $this->imap->folder_sync($this->folder->name); @@ -186,7 +187,7 @@ class kolab_storage_cache kolab_storage::get_folder($foldername)->cache->set($msguid, $object); return; } - + // write to cache if ($this->ready) { // remove old entry @@ -303,7 +304,7 @@ class kolab_storage_cache $filter = $this->_query2assoc($query); // use 'list' for folder's default objects - if ($filter['type'] == $this->type) { + if ($filter['type'] == $this->type && !empty($this->index)) { $index = $this->index; } else { // search by object type @@ -483,7 +484,7 @@ class kolab_storage_cache private function _sync_lock() { if (!$this->ready) - return; + return false; $sql_arr = $this->db->fetch_assoc($this->db->query( "SELECT msguid AS locked FROM kolab_cache ". @@ -517,6 +518,8 @@ class kolab_storage_cache 'lock' ); } + + return true; } /**