commit 877ff972a9b79c807eb75839594ce58dfa928d94
parent 137a0ebbfda5c7d92879be9a1670d1248a2723bf
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 11 Mar 2018 01:20:40 -0500
Select created items when importing RIS/BibTeX from connector
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js
@@ -854,7 +854,11 @@ Zotero.Server.Connector.Import.prototype = {
}
let items = yield translate.translate({
libraryID: library.libraryID,
- collections: collection ? [collection.id] : null
+ collections: collection ? [collection.id] : null,
+ // Import translation skips selection by default, so force it to occur
+ saveOptions: {
+ skipSelect: false
+ }
});
return [201, "application/json", JSON.stringify(items)];
})
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -1299,6 +1299,7 @@ Zotero.Translate.Base.prototype = {
}
this._collections = options.collections;
this._saveAttachments = options.saveAttachments === undefined || options.saveAttachments;
+ this._saveOptions = options.saveOptions;
this._savingAttachments = [];
this._savingItems = 0;
@@ -2369,9 +2370,12 @@ Zotero.Translate.Import.prototype._prepareTranslation = Zotero.Promise.method(fu
collections: this._collections,
attachmentMode: Zotero.Translate.ItemSaver[(this._saveAttachments ? "ATTACHMENT_MODE_FILE" : "ATTACHMENT_MODE_IGNORE")],
baseURI,
- saveOptions: {
- skipSelect: true
- }
+ saveOptions: Object.assign(
+ {
+ skipSelect: true
+ },
+ this._saveOptions || {}
+ )
});
this.newItems = [];
this.newCollections = [];