summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-28 10:27:42 (GMT)
committerAleksander Machniak <alec@alec.pl>2015-01-28 10:27:42 (GMT)
commit902b59d0d591fef2c1c591ecb0af931763cbb3ab (patch)
tree7d1c425bc77cb05401ef209dbaa9e40a937b997f
parent4572da65734825a52e7ad6f77b0f09071e4aa5b3 (diff)
downloadroundcubemail-plugins-kolab-902b59d0d591fef2c1c591ecb0af931763cbb3ab.tar.gz
Skip some sql queries if $this->ready-false (#4370)
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache.php5
1 files changed, 3 insertions, 2 deletions
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(