From 0ae070970ab179a724ab734bcf9fb3fb64b7f007 Mon Sep 17 00:00:00 2001 From: Joscha Legewie Date: Sun, 22 May 2016 13:42:39 -0400 Subject: [PATCH] Support String for options.file in Zotero.Attachments.linkFromFile (#1005) --- chrome/content/zotero/xpcom/attachments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 798e4a90b7..2683403cdc 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -121,7 +121,7 @@ Zotero.Attachments = new function(){ /** - * @param {nsIFile} [options.file] - File to link to + * @param {nsIFile|String} [options.file] - File to add * @param {Integer[]|String[]} [options.parentItemID] - Parent item to add item to * @param {Integer[]} [options.collections] - Collection keys or ids to add new item to * @param {Object} [options.saveOptions] - Options to pass to Zotero.Item::save() @@ -130,7 +130,7 @@ Zotero.Attachments = new function(){ this.linkFromFile = Zotero.Promise.coroutine(function* (options) { Zotero.debug('Linking attachment from file'); - var file = options.file; + var file = Zotero.File.pathToFile(options.file); var parentItemID = options.parentItemID; var collections = options.collections; var saveOptions = options.saveOptions;