Fix "Import into new collection" option when handling importable file

This commit is contained in:
Dan Stillman 2018-06-14 16:40:03 -04:00
parent d38d55e2b4
commit 0383f104dd
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -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
});
}
}
});