Replace deprecated usage of Utilities.itemToCSLJSON
This commit is contained in:
parent
82eb7453a8
commit
62e2ccafa0
2 changed files with 6 additions and 6 deletions
|
@ -541,7 +541,7 @@ Zotero.Cite.System.prototype = {
|
||||||
throw new Error("Zotero.Cite.System.retrieveItem called on non-item "+item);
|
throw new Error("Zotero.Cite.System.retrieveItem called on non-item "+item);
|
||||||
}
|
}
|
||||||
|
|
||||||
var cslItem = Zotero.Utilities.itemToCSLJSON(zoteroItem);
|
var cslItem = Zotero.Utilities.Item.itemToCSLJSON(zoteroItem);
|
||||||
|
|
||||||
// TEMP: citeproc-js currently expects the id property to be the item DB id
|
// TEMP: citeproc-js currently expects the id property to be the item DB id
|
||||||
cslItem.id = zoteroItem.id;
|
cslItem.id = zoteroItem.id;
|
||||||
|
|
|
@ -355,7 +355,7 @@ class EditorInstance {
|
||||||
|
|
||||||
// Note: integration.js` uses `Zotero.Cite.System.prototype.retrieveItem`,
|
// Note: integration.js` uses `Zotero.Cite.System.prototype.retrieveItem`,
|
||||||
// which produces a little bit different CSL JSON
|
// which produces a little bit different CSL JSON
|
||||||
let itemData = Zotero.Utilities.itemToCSLJSON(parentItem);
|
let itemData = Zotero.Utilities.Item.itemToCSLJSON(parentItem);
|
||||||
if (!skipEmbeddingItemData) {
|
if (!skipEmbeddingItemData) {
|
||||||
citationItem.itemData = itemData;
|
citationItem.itemData = itemData;
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ class EditorInstance {
|
||||||
|
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
if (item.isRegularItem()) {
|
if (item.isRegularItem()) {
|
||||||
let itemData = Zotero.Utilities.itemToCSLJSON(item);
|
let itemData = Zotero.Utilities.Item.itemToCSLJSON(item);
|
||||||
let citation = {
|
let citation = {
|
||||||
citationItems: [{
|
citationItems: [{
|
||||||
uris: [Zotero.URI.getItemURI(item)],
|
uris: [Zotero.URI.getItemURI(item)],
|
||||||
|
@ -715,7 +715,7 @@ class EditorInstance {
|
||||||
let citationItem = {};
|
let citationItem = {};
|
||||||
citationItem.id = item.id;
|
citationItem.id = item.id;
|
||||||
citationItem.uris = [Zotero.URI.getItemURI(item)];
|
citationItem.uris = [Zotero.URI.getItemURI(item)];
|
||||||
citationItem.itemData = Zotero.Utilities.itemToCSLJSON(item);
|
citationItem.itemData = Zotero.Utilities.Item.itemToCSLJSON(item);
|
||||||
citation.citationItems.push(citationItem);
|
citation.citationItems.push(citationItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -767,7 +767,7 @@ class EditorInstance {
|
||||||
for (let { uris } of citationItemsList) {
|
for (let { uris } of citationItemsList) {
|
||||||
let item = await Zotero.EditorInstance.getItemFromURIs(uris);
|
let item = await Zotero.EditorInstance.getItemFromURIs(uris);
|
||||||
if (item) {
|
if (item) {
|
||||||
let itemData = Zotero.Utilities.itemToCSLJSON(item);
|
let itemData = Zotero.Utilities.Item.itemToCSLJSON(item);
|
||||||
citationItems.push({ uris, itemData });
|
citationItems.push({ uris, itemData });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1277,7 +1277,7 @@ class EditorInstance {
|
||||||
else if (citationItem.id) {
|
else if (citationItem.id) {
|
||||||
let item = await Zotero.Items.getAsync(parseInt(citationItem.id));
|
let item = await Zotero.Items.getAsync(parseInt(citationItem.id));
|
||||||
citationItem.uris = [Zotero.URI.getItemURI(item)];
|
citationItem.uris = [Zotero.URI.getItemURI(item)];
|
||||||
citationItem.itemData = Zotero.Utilities.itemToCSLJSON(item);
|
citationItem.itemData = Zotero.Utilities.Item.itemToCSLJSON(item);
|
||||||
}
|
}
|
||||||
// Otherwise it's existing item, so just passing untouched citationItem
|
// Otherwise it's existing item, so just passing untouched citationItem
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue