www

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

commit 211da93be46253e31a337e3ad627fe12dc9c1750
parent 236901c1adaca9d32595fb769868ce63d2aedd8d
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 29 Aug 2011 19:33:52 +0000

Duplicate detection fixes:

- Fix saving of fields from other versions of an item
- Relations (e.g., cross-library links) were merged incorrectly


Diffstat:
Mchrome/content/zotero/duplicatesMerge.js | 6+-----
Mchrome/content/zotero/xpcom/data/items.js | 7++++---
2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/chrome/content/zotero/duplicatesMerge.js b/chrome/content/zotero/duplicatesMerge.js @@ -147,10 +147,6 @@ var Zotero_Duplicates_Pane = new function () { this.merge = function () { var itembox = document.getElementById('zotero-duplicates-merge-item-box'); - // Work around item.clone() weirdness -- the cloned item can't safely be - // used after it's saved, because it's not the version in memory and - // doesn't get reloaded properly in item.save() - var item = Zotero.Items.get(itembox.item.id); - Zotero.Items.merge(item, _otherItems); + Zotero.Items.merge(itembox.item, _otherItems); } } diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js @@ -413,13 +413,12 @@ Zotero.Items = new function() { for each(var relatedItemID in relatedItems) { item.addRelatedItem(relatedItemID); } - item.save(); // Relations Zotero.Relations.copyURIs( item.libraryID, - Zotero.URI.getItemURI(item), - Zotero.URI.getItemURI(otherItem) + Zotero.URI.getItemURI(otherItem), + Zotero.URI.getItemURI(item) ); // Add relation to track merge @@ -431,6 +430,8 @@ Zotero.Items = new function() { otherItem.save(); } + item.save(); + Zotero.DB.commitTransaction(); }