From 0383f104dd88e306391afcfa3438b1209cec1762 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 14 Jun 2018 16:40:03 -0400 Subject: [PATCH] Fix "Import into new collection" option when handling importable file --- chrome/content/zotero/fileInterface.js | 5 ++++- components/zotero-service.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index d79c4b6546..234715edba 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -306,7 +306,10 @@ var Zotero_File_Interface = new function() { } if (typeof options == 'string' || options instanceof Components.interfaces.nsIFile) { Zotero.debug("WARNING: importFile() now takes a single options object -- update your code"); - options = { file: options }; + options = { + file: options, + createNewCollection: arguments[1] + }; } var file = options.file ? Zotero.File.pathToFile(options.file) : null; diff --git a/components/zotero-service.js b/components/zotero-service.js index 751935df52..8cb26d9b2f 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -636,7 +636,10 @@ ZoteroCommandLineHandler.prototype = { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWindow = wm.getMostRecentWindow("navigator:browser"); - browserWindow.Zotero_File_Interface.importFile(file, checkState.value); + browserWindow.Zotero_File_Interface.importFile({ + file, + createNewCollection: checkState.value + }); } } });