diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index 6d3fb6663..fd8adbcd2 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -524,6 +524,9 @@ Zotero.Cite.System.prototype = { var cslItem = Zotero.Utilities.itemToCSLJSON(zoteroItem); + // TEMP: citeproc-js currently expects the id property to be the item DB id + cslItem.id = zoteroItem.id; + if (!Zotero.Prefs.get("export.citePaperJournalArticleURL")) { var itemType = Zotero.ItemTypes.getName(zoteroItem.itemTypeID); // don't return URL or accessed information for journal articles if a diff --git a/test/content/support.js b/test/content/support.js index ff44fd84b..2f67b97f6 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -419,25 +419,13 @@ function generateCiteProcJSExportData(currentData) { let zItem = Zotero.Items.get(items[itemName].id); cslExportData[itemName] = Zotero.Cite.System.prototype.retrieveItem(zItem); - // Don't replace id as long as it follows expected format if (!currentData || !currentData[itemName]) continue; - // For simplicity, be more lenient than for item key - let idRe = /^http:\/\/zotero\.org\/users\/local\/\w{8}\/items\/\w{8}$/; - for (let field in cslExportData[itemName]) { - let oldVal = currentData[itemName][field]; - if (!oldVal) continue; - - let val = cslExportData[itemName][field]; - switch (field) { - case 'id': - if (!idRe.test(oldVal) || !idRe.test(val)) continue; - break; - default: - continue; - } - - cslExportData[itemName][field] = oldVal; + // Don't replace id as long as it follows expected format + if (Number.isInteger(currentData[itemName].id) + && Number.isInteger(cslExportData[itemName].id) + ) { + cslExportData[itemName].id = currentData[itemName].id; } }