From 56f9f04340685edc6d0e2145a655b3cc2eba46fc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 25 Jun 2017 04:38:12 -0400 Subject: [PATCH] Partial fix for CSL JSON export in translation-server Zotero.Item doesn't exist in translation-server Addresses zotero/translation-server#12 --- chrome/content/zotero/xpcom/utilities.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 0e937bd77..1f7c15902 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1660,7 +1660,9 @@ Zotero.Utilities = { "itemToCSLJSON":function(zoteroItem) { // If a Zotero.Item was passed, convert it to the proper format (skipping child items) and // call this function again with that object - if (zoteroItem instanceof Zotero.Item) { + // + // (Zotero.Item won't be defined in translation-server) + if (typeof Zotero.Item !== 'undefined' && zoteroItem instanceof Zotero.Item) { return this.itemToCSLJSON( Zotero.Utilities.Internal.itemToExportFormat(zoteroItem, false, true) );