From a91957c588830e9528150225442309b39c837aa2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 24 Apr 2016 02:44:21 -0400 Subject: [PATCH] Fix #956, 5.0: Merging of duplicate items is not working --- chrome/content/zotero/xpcom/data/relations.js | 3 ++- test/tests/duplicatesTest.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/relations.js b/chrome/content/zotero/xpcom/data/relations.js index 66068c770c..56fa1f6fd7 100644 --- a/chrome/content/zotero/xpcom/data/relations.js +++ b/chrome/content/zotero/xpcom/data/relations.js @@ -149,7 +149,8 @@ Zotero.Relations = new function () { this.getByObject = function (objectType, object) { var objectsClass = Zotero.DataObjectUtilities.getObjectsClassForObjectType(objectType); var predicateIDs = []; - var o = _subjectPredicatesByObject[objectType][object]; + var o = _subjectPredicatesByObject[objectType] + ? _subjectPredicatesByObject[objectType][object] : false; if (!o) { return []; } diff --git a/test/tests/duplicatesTest.js b/test/tests/duplicatesTest.js index d7d84a1d83..0e1a327149 100644 --- a/test/tests/duplicatesTest.js +++ b/test/tests/duplicatesTest.js @@ -3,6 +3,12 @@ describe("Duplicate Items", function () { var win, zp, cv; + before(function* () { + yield resetDB({ + thisArg: this, + skipBundledFiles: true + }); + }); beforeEach(function* () { Zotero.Prefs.clear('duplicateLibraries'); win = yield loadZoteroPane();