diff --git a/chrome/content/zotero/reportInterface.js b/chrome/content/zotero/reportInterface.js index dc5b834553..9144d16a1a 100644 --- a/chrome/content/zotero/reportInterface.js +++ b/chrome/content/zotero/reportInterface.js @@ -67,12 +67,7 @@ var Zotero_Report_Interface = new function() { var items = ZoteroPane_Local.getSelectedItems(); if (!items || !items.length) { - throw ('No items currently selected'); - } - - var keyHashes = []; - for each(var item in items) { - keyHashes.push(Zotero.Items.getLibraryKeyHash(item)); + throw new Error('No items currently selected'); } var url = 'zotero://report/' + Zotero.API.getLibraryPrefix(libraryID) + '/items/report.html' diff --git a/chrome/content/zotero/xpcom/api.js b/chrome/content/zotero/xpcom/api.js index fbe14cc927..d50f21086e 100644 --- a/chrome/content/zotero/xpcom/api.js +++ b/chrome/content/zotero/xpcom/api.js @@ -46,7 +46,7 @@ Zotero.API = { switch (params.scopeObject) { case 'collections': if (params.scopeObjectKey) { - var col = Zotero.Collections.getByLibraryAndKeyAsync( + var col = Zotero.Collections.getByLibraryAndKey( params.libraryID, params.scopeObjectKey ); } @@ -61,12 +61,12 @@ Zotero.API = { case 'searches': if (params.scopeObjectKey) { - var s = yield Zotero.Searches.getByLibraryAndKeyAsync( + var s = Zotero.Searches.getByLibraryAndKey( params.libraryID, params.scopeObjectKey ); } else { - var s = yield Zotero.Searches.getAsync(params.scopeObjectID); + var s = Zotero.Searches.get(params.scopeObjectID); } if (!s) { throw new Error('Invalid search ID or key'); @@ -145,15 +145,19 @@ Zotero.API = { getLibraryPrefix: function (libraryID) { - switch (Zotero.Libraries.getType(libraryID)) { + var type = Zotero.Libraries.get(libraryID).libraryType; + switch (type) { case 'user': return 'library'; case 'publications': return 'publications'; - case 'groups': + case 'group': return 'groups/' + Zotero.Groups.getGroupIDFromLibraryID(libraryID); + + default: + throw new Error(`Invalid type '${type}`); } } }; diff --git a/chrome/content/zotero/xpcom/report.js b/chrome/content/zotero/xpcom/report.js index e6e2797625..c58e3953ec 100644 --- a/chrome/content/zotero/xpcom/report.js +++ b/chrome/content/zotero/xpcom/report.js @@ -213,8 +213,8 @@ Zotero.Report.HTML = new function () { case 'reportSearchMatch': case 'reportChildren': - case 'itemKey': - case 'itemVersion': + case 'key': + case 'version': case 'itemType': case 'title': case 'creators':