commit 0ae070970ab179a724ab734bcf9fb3fb64b7f007
parent e21a914a1fc2279b21746d9484b9cd7137fff628
Author: Joscha Legewie <joscha.legewie@gmail.com>
Date: Sun, 22 May 2016 13:42:39 -0400
Support String for options.file in Zotero.Attachments.linkFromFile (#1005)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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;