Ignore base-mapped fields more robustly

This commit is contained in:
Abe Jellinek 2024-01-29 13:31:48 -05:00 committed by Dan Stillman
parent b8c1b7c139
commit af79e9c405

View file

@ -438,6 +438,17 @@
return '(' + Zotero.getString('pane.item.defaultFullName') + ')';
}
get _ignoreFields() {
let value = ['title', 'abstractNote']
.flatMap(field => [
field,
...(Zotero.ItemFields.getTypeFieldsFromBase(field, true) || [])
]);
// Cache the result
Object.defineProperty(this, '_ignoreFields', { value });
return value;
}
get _linkMenu() {
return this._id('zotero-link-menu');
}
@ -526,7 +537,7 @@
for (let i = 0; i < fieldNames.length; i++) {
var fieldName = fieldNames[i];
if (["abstractNote", "title", "caseName", "subject"].includes(fieldName)) {
if (this._ignoreFields.includes(fieldName)) {
continue;
}
var val = '';