From 2008ba284b874b12b9c4dceabd188fd955e2a15e Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 18 Sep 2015 15:22:42 +0200 Subject: [PATCH] improved sphinx update --- src/config.h | 2 +- webui/model/folder/folder.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config.h b/src/config.h index a8ad232b..3cea5604 100644 --- a/src/config.h +++ b/src/config.h @@ -14,7 +14,7 @@ #define VERSION "1.2.0-master" -#define BUILD 921 +#define BUILD 922 #define HOSTID "mailarchiver" diff --git a/webui/model/folder/folder.php b/webui/model/folder/folder.php index 6306874d..077acba1 100644 --- a/webui/model/folder/folder.php +++ b/webui/model/folder/folder.php @@ -198,9 +198,9 @@ class ModelFolderFolder extends Model { public function update_message_folder($id = 0, $folder_id = 0) { $query = $this->db->query("UPDATE `" . TABLE_FOLDER_MESSAGE . "` SET folder_id=? WHERE id=?", array($folder_id, $id)); - - //$query = $this->sphx->query("UPDATE " . SPHINX_MAIN_INDEX . " SET folder=? WHERE id=?", array($folder_id, $id)); - $query = $this->sphx->query("UPDATE " . SPHINX_MAIN_INDEX . " SET folder=$folder_id WHERE id=$id"); + if($this->db->countAffected() == 0) { + $query = $this->sphx->query("UPDATE " . SPHINX_MAIN_INDEX . " SET folder=$folder_id WHERE id=$id"); + } }