commit 5c1ffd1e2f301ea18412f27e5438515a15a525ac
parent f2a354571886f02af5044aa100620115c64112ff
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 8 Aug 2009 10:06:34 +0000
Reset storageModTime to 0 if < 0 and prevent setting < 0, though it shouldn't happen to begin with
Diffstat:
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
@@ -2443,6 +2443,10 @@ Zotero.Schema = new function(){
Zotero.DB.query("UPDATE itemNotes SET sourceItemID=NULL WHERE sourceItemID=itemID");
}
+ if (i==61) {
+ Zotero.DB.query("UPDATE itemAttachments SET storageModTime=NULL WHERE storageModTime<0");
+ }
+
Zotero.wait();
}
diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js
@@ -343,6 +343,12 @@ Zotero.Sync.Storage = new function () {
* attachment item
*/
this.setSyncedModificationTime = function (itemID, mtime, updateItem) {
+ if (mtime < 0) {
+ Components.utils.reportError("Invalid file mod time " + mtime
+ + " in Zotero.Storage.setSyncedModificationTime()");
+ mtime = 0;
+ }
+
Zotero.DB.beginTransaction();
var sql = "UPDATE itemAttachments SET storageModTime=? WHERE itemID=?";
diff --git a/userdata.sql b/userdata.sql
@@ -1,4 +1,4 @@
--- 60
+-- 61
-- This file creates tables containing user-specific data for new users --
-- any changes made here must be mirrored in transition steps in schema.js::_migrateSchema()