Do not strip abstract from citation items data in notes

This commit is contained in:
Martynas Bagdonas 2021-04-05 08:55:35 +03:00
parent c3a74a22d7
commit bbb0f8bca4
3 changed files with 2 additions and 7 deletions

View file

@ -198,7 +198,6 @@ Zotero.Notes = new function() {
/** /**
* Upgrade v1 notes: * Upgrade v1 notes:
* - Pull itemData from citations, highlights, images into metadata container * - Pull itemData from citations, highlights, images into metadata container
* - Strip abstract field from itemData
* - For `data-annotation` keep only the following fields: * - For `data-annotation` keep only the following fields:
* - uri * - uri
* - text * - text
@ -208,7 +207,7 @@ Zotero.Notes = new function() {
* - citationItem * - citationItem
* - Increase schema version number * - Increase schema version number
* *
* @param item * @param {Zotero.Item} item
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
this.upgradeSchemaV1 = async function (item) { this.upgradeSchemaV1 = async function (item) {
@ -240,7 +239,6 @@ Zotero.Notes = new function() {
function pullItemData(citationItem) { function pullItemData(citationItem) {
let { uris, itemData } = citationItem; let { uris, itemData } = citationItem;
if (itemData) { if (itemData) {
delete citationItem.itemData.abstract;
delete citationItem.itemData; delete citationItem.itemData;
let item = storedCitationItems.find(item => item.uris.some(uri => uris.includes(uri))); let item = storedCitationItems.find(item => item.uris.some(uri => uris.includes(uri)));
if (!item) { if (!item) {

View file

@ -239,7 +239,6 @@ class EditorInstance {
// TODO: Find a more elegant way to call this // TODO: Find a more elegant way to call this
let itemData = Zotero.Cite.System.prototype.retrieveItem(parentItem); let itemData = Zotero.Cite.System.prototype.retrieveItem(parentItem);
delete itemData.abstract;
if (!skipEmbeddingItemData) { if (!skipEmbeddingItemData) {
citationItem.itemData = itemData; citationItem.itemData = itemData;
} }
@ -304,7 +303,6 @@ class EditorInstance {
} }
if (item.isRegularItem()) { if (item.isRegularItem()) {
let itemData = Zotero.Cite.System.prototype.retrieveItem(item); let itemData = Zotero.Cite.System.prototype.retrieveItem(item);
delete itemData.abstract;
let citation = { let citation = {
citationItems: [{ citationItems: [{
uris: [Zotero.URI.getItemURI(item)], uris: [Zotero.URI.getItemURI(item)],
@ -942,7 +940,6 @@ class EditorInstance {
delete citationItem.id; delete citationItem.id;
citationItem.uris = [Zotero.URI.getItemURI(item)]; citationItem.uris = [Zotero.URI.getItemURI(item)];
citationItem.itemData = Zotero.Cite.System.prototype.retrieveItem(item); citationItem.itemData = Zotero.Cite.System.prototype.retrieveItem(item);
delete citationItem.itemData.abstract;
} }
let formattedCitation = (await that._getFormattedCitationParts(citation)).join(';'); let formattedCitation = (await that._getFormattedCitationParts(citation)).join(';');

@ -1 +1 @@
Subproject commit c5dfc982c09915e5a2fb6103edf0395dc17ce728 Subproject commit 53d2342f8d7c2dc1cd8b002ef8c76a8360328965