From 13c4bbebfae3cc5fc3b3a0db6ba3b396051c1bdc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 29 Apr 2016 20:25:11 -0400 Subject: [PATCH] Save master item when merging --- chrome/content/zotero/xpcom/data/items.js | 2 +- test/tests/itemsTest.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index 215b1023c7..018fcf9f34 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -741,7 +741,7 @@ Zotero.Items = function() { var replPred = Zotero.Relations.replacedItemPredicate; var toSave = {}; - toSave[this.id]; + toSave[item.id] = item; for each(var otherItem in otherItems) { let otherItemURI = Zotero.URI.getItemURI(otherItem); diff --git a/test/tests/itemsTest.js b/test/tests/itemsTest.js index c97512bfb7..a7a44d1b90 100644 --- a/test/tests/itemsTest.js +++ b/test/tests/itemsTest.js @@ -27,6 +27,7 @@ describe("Zotero.Items", function () { assert.isTrue(item2.deleted); // Check for merge-tracking relation + assert.isFalse(item1.hasChanged()); var rels = item1.getRelationsByPredicate(Zotero.Relations.replacedItemPredicate); assert.lengthOf(rels, 1); assert.equal(rels[0], item2URI);