diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index d149a33534..8e38cc6b5a 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -211,11 +211,8 @@ Zotero.Sync.Storage = new function () { if (updateItem) { // Update item date modified so the new mod time will be synced - var item = Zotero.Items.get(itemID); - //var date = new Date(mtime * 1000); - //item.setField('dateModified', Zotero.Date.dateToSQL(date, true)); - item.setField('dateModified', Zotero.DB.transactionDateTime); - item.save(); + var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?"; + Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]); } Zotero.DB.commitTransaction(); @@ -254,10 +251,9 @@ Zotero.Sync.Storage = new function () { Zotero.DB.valueQuery(sql, [hash, itemID]); if (updateItem) { - // Update item date modified so the new hash will be synced - var item = Zotero.Items.get(itemID); - item.setField('dateModified', Zotero.DB.transactionDateTime); - item.save(); + // Update item date modified so the new mod time will be synced + var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?"; + Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]); } Zotero.DB.commitTransaction(); diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index de26b374d1..49b32b9e28 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -515,7 +515,7 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._onUploadComplete = function (httpR Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true); var hash = item.attachmentHash; - Zotero.Sync.Storage.setSyncedHash(item.id, hash, true); + Zotero.Sync.Storage.setSyncedHash(item.id, hash); Zotero.DB.commitTransaction(); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index 5354f5c4eb..a30c830d3c 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -633,12 +633,12 @@ Zotero.Sync.Storage.Session.ZFS.prototype._updateItemFileInfo = function (item) // Store file mod time var mtime = item.attachmentModificationTime; - Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, false); + Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true); // Store file hash of individual files if (Zotero.Attachments.getNumFiles(item) == 1) { var hash = item.attachmentHash; - Zotero.Sync.Storage.setSyncedHash(item.id, hash, true); + Zotero.Sync.Storage.setSyncedHash(item.id, hash); } Zotero.DB.commitTransaction();