www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 9e9f8db1df7f9adffb5a5b22c52a79dccb2d0340
parent 7008fa41cfacc75d07efb3e0ba6c3ae0a9e27be4
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  6 Jul 2009 11:27:44 +0000

- Fix sync error when a file of an attachment with tags was in conflict
- Missed file from previous commit


Diffstat:
Mchrome/content/zotero/overlay.xul | 2+-
Mchrome/content/zotero/xpcom/data/item.js | 9+++++++--
Mchrome/content/zotero/xpcom/storage.js | 5+++--
3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul @@ -354,7 +354,7 @@ </tooltip> </hbox> <toolbarbutton id="zotero-tb-sync" class="zotero-small-progress-indicator" tooltip="_child" - oncommand="Zotero.Sync.Runner.sync()"> + oncommand="Zotero.Sync.Server.canAutoResetClient = true; Zotero.Sync.Runner.sync()"> <tooltip onpopupshowing="ZoteroPane.setLastSyncStatus(this)" noautohide="true"> diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -3379,8 +3379,13 @@ Zotero.Item.prototype.diff = function (item, includeMatches, ignoreFields) { /** * Returns an unsaved copy of the item + * + * @param {Boolean} [includePrimary=false] + * @param {Zotero.Item} [newItem=null] Target item for clone (used to pass a saved + * item for duplicating items with tags) + * @param {Boolean} [unsaved=false] Skip properties that require a saved object (e.g., tags) */ -Zotero.Item.prototype.clone = function(includePrimary, newItem) { +Zotero.Item.prototype.clone = function(includePrimary, newItem, unsaved) { Zotero.debug('Cloning item ' + this.id); if (includePrimary && newItem) { @@ -3521,7 +3526,7 @@ Zotero.Item.prototype.clone = function(includePrimary, newItem) { } } - if (obj.tags) { + if (!unsaved && obj.tags) { for each(var tag in obj.tags) { if (sameLibrary) { newItem.addTagByID(tag.primary.tagID); diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js @@ -2375,10 +2375,10 @@ Zotero.Sync.Storage.QueueManager = new function () { var objectPairs = []; for each(var conflict in _conflicts) { var item = Zotero.Items.getByLibraryAndKey(null, conflict.name); - var item1 = item.clone(); + var item1 = item.clone(false, false, true); item1.setField('dateModified', Zotero.Date.dateToSQL(new Date(conflict.localData.modTime * 1000), true)); - var item2 = item.clone(); + var item2 = item.clone(false, false, true); item2.setField('dateModified', Zotero.Date.dateToSQL(new Date(conflict.remoteData.modTime * 1000), true)); objectPairs.push([item1, item2]); @@ -2480,6 +2480,7 @@ Zotero.Sync.Storage.Queue = function (name) { Zotero.debug(this.Name + " queue is done"); // DEBUG info Zotero.debug("Active requests: " + this.activeRequests); + Zotero.debug("Errors:"); Zotero.debug(this._errors); if (this.activeRequests) {