Don't save library catalog from translation if not valid for item type
Fixes #1781
This commit is contained in:
parent
4e11c7927d
commit
851af7f45b
1 changed files with 9 additions and 0 deletions
|
@ -607,6 +607,15 @@ Zotero.Translate.Sandbox = {
|
|||
if(item.libraryCatalog === undefined && item.itemType != "webpage") {
|
||||
item.libraryCatalog = translate.translator[0].label;
|
||||
}
|
||||
|
||||
// Remove library catalog if not valid for type, so it doesn't get saved to Extra
|
||||
if (item.libraryCatalog) {
|
||||
let itemTypeID = Zotero.ItemTypes.getID(item.itemType);
|
||||
let fieldID = Zotero.ItemFields.getID('libraryCatalog');
|
||||
if (!Zotero.ItemFields.isValidForType(fieldID, itemTypeID)) {
|
||||
delete item.libraryCatalog;
|
||||
}
|
||||
}
|
||||
|
||||
// automatically set access date if URL is set
|
||||
if(item.url && typeof item.accessDate == 'undefined') {
|
||||
|
|
Loading…
Reference in a new issue