Branch 'roundcubemail-plugins-kolab-3.1' - plugins/libkolab

Aleksander Machniak machniak at kolabsys.com
Wed Jan 28 11:28:10 CET 2015


 plugins/libkolab/lib/kolab_storage_cache.php |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 902b59d0d591fef2c1c591ecb0af931763cbb3ab
Author: Aleksander Machniak <alec at alec.pl>
Date:   Wed Jan 28 11:27:42 2015 +0100

    Skip some sql queries if $this->ready-false (#4370)

diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
index 4fa3d09..fbb9322 100644
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -367,7 +367,7 @@ class kolab_storage_cache
         unset($target->cache->uid2msg[$uid]);
 
         // resolve new message UID in target folder
-        if ($new_msguid = $target->cache->uid2msguid($uid)) {
+        if ($this->ready && ($new_msguid = $target->cache->uid2msguid($uid))) {
             $this->_read_folder_data();
 
             $this->db->query(
@@ -399,6 +399,7 @@ class kolab_storage_cache
             "DELETE FROM $this->cache_table WHERE folder_id=?",
             $this->folder_id
         );
+
         return $this->db->affected_rows($result);
     }
 
@@ -510,7 +511,7 @@ class kolab_storage_cache
     public function count($query = array())
     {
         // cache is in sync, we can count records in local DB
-        if ($this->synched) {
+        if ($this->synched && $this->ready) {
             $this->_read_folder_data();
 
             $sql_result = $this->db->query(




More information about the commits mailing list