commit 7dda5a2f69e12def62bd457d352e3507f726ba3c
parent b0ef76cf5720a2e4065a28fe4b8b10642811d325
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 11 Jun 2016 14:54:06 -0400
Fix saving to collection from fallback search translators
Fixes #1028
Diffstat:
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -1225,6 +1225,7 @@ Zotero.Translate.Base.prototype = {
this._libraryID = options.libraryID;
this._collections = options.collections;
this._saveAttachments = options.saveAttachments === undefined || options.saveAttachments;
+
this._savingAttachments = [];
this._savingItems = 0;
this._waitingForSave = false;
@@ -2446,7 +2447,8 @@ Zotero.Translate.Search.prototype.complete = function(returnValue, error) {
this.translator.shift();
this.translate({
libraryID: this._libraryID,
- saveAttachments: this._saveAttachments
+ saveAttachments: this._saveAttachments,
+ collections: this._collections
});
return;
} else {
diff --git a/test/tests/lookupTest.js b/test/tests/lookupTest.js
@@ -56,9 +56,16 @@ describe.skip("Add Item by Identifier", function() {
var col = yield createDataObject('collection');
yield waitForItemsLoad(win);
+ // Initial translator
var ids = yield lookupIdentifier(win, "10.4103/0976-500X.85940");
var item = Zotero.Items.get(ids[0]);
assert.equal(item.getField("title"), "Zotero: A bibliographic assistant to researcher");
assert.isTrue(item.inCollection(col.id));
+
+ // Fallback translator
+ var ids = yield lookupIdentifier(win, "10.5281/zenodo.55073");
+ var item = Zotero.Items.get(ids[0]);
+ assert.equal(item.getField("title"), "Comparison of Spectral Methods Through the Adjacency Matrix and the Laplacian of a Graph");
+ assert.isTrue(item.inCollection(col.id));
});
});
\ No newline at end of file