diff --git a/lib/kolab_sync_storage.php b/lib/kolab_sync_storage.php --- a/lib/kolab_sync_storage.php +++ b/lib/kolab_sync_storage.php @@ -1928,14 +1928,11 @@ $this->relations[$folderid][$synctime] = $relations; $data = rcube_charset::clean(json_encode($relations)); - $result = $db->query( - "INSERT INTO `syncroton_relations_state`" - . " (`device_id`, `folder_id`, `synctime`, `data`)" - . " VALUES (?, ?, ?, ?)", - $device_key, - $folderid, - $synctime, - $data + $result = $db->insert_or_update( + 'syncroton_relations_state', + ['device_id' => $device_key, 'folder_id' => $folderid, 'synctime' => $synctime], + ['data'], + [$data] ); if ($err = $db->is_error($result)) {