Duplicate detection fixes:
- Fix saving of fields from other versions of an item - Relations (e.g., cross-library links) were merged incorrectly
This commit is contained in:
parent
236901c1ad
commit
211da93be4
2 changed files with 5 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue