Skip to content

Commit

Permalink
Fix signatures on itemToCSLJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Jun 26, 2017
1 parent 4419348 commit bb2004c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions chrome/content/zotero/xpcom/cite.js
Expand Up @@ -546,10 +546,9 @@ Zotero.Cite.System.prototype = {

var cslItem;
try {
cslItem = Zotero.Utilities.itemToCSLJSON(zoteroItem);
cslItem = Zotero.Utilities.itemToCSLJSON(zoteroItem, false);
} catch (e) {
Zotero.debug("Warning: saw item as changed in toJSON(). Missing jurisdiction in online item?: "+e);
cslItem = Zotero.Utilities.itemToCSLJSON(zoteroItem, false, false, false, true);
throw "Error converting item to CSL format: " + e;
}

// TEMP: citeproc-js currently expects the id property to be the item DB id
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/zotero/xpcom/integration.js
Expand Up @@ -2514,7 +2514,7 @@ Zotero.Integration.Session.prototype.lookupItems = Zotero.Promise.coroutine(func
surrogateItem.cslItemData = itemData;

// Puts encoded multi fields into Zotero item
this.embeddedItems[anonymousID] = Zotero.Utilities.itemToCSLJSON(surrogateItem, undefined, false, false, true);
this.embeddedItems[anonymousID] = Zotero.Utilities.itemToCSLJSON(surrogateItem, true);
for(var j=0, m=citationItem.uris.length; j<m; j++) {
this.embeddedZoteroItemsByURI[citationItem.uris[j]] = surrogateItem;
}
Expand Down
5 changes: 2 additions & 3 deletions chrome/content/zotero/xpcom/utilities.js
Expand Up @@ -2041,14 +2041,13 @@ Zotero.Utilities = {
* @return {Object|Promise<Object>} A CSL item, or a promise for a CSL item if a Zotero.Item
* is passed
*/
"itemToCSLJSON":function(zoteroItem, portableJSON, stopAuthority) {
"itemToCSLJSON":function(zoteroItem, portableJSON) {
// 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) {
return this.itemToCSLJSON(
Zotero.Utilities.Internal.itemToExportFormat(zoteroItem, false, true),
portableJSON,
stopAuthority
portableJSON
);
}

Expand Down

0 comments on commit bb2004c

Please sign in to comment.