Fix error message for invalid field in Item.setField()

The error message was showing a field instead of an item type.

https://forums.zotero.org/discussion/100598/error-1533410729-impossible-to-correct-date-field-in-items-added-with-zotero-conector-ver-6-0-15
This commit is contained in:
Dan Stillman 2022-10-22 05:28:02 -04:00
parent 2fa67bae64
commit f2bfaeb7a9

View file

@ -777,7 +777,7 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
if (value !== false && !Zotero.ItemFields.isValidForType(fieldID, itemTypeID)) {
let msg = "'" + field + "' is not a valid field for type '"
+ Zotero.ItemFields.getName(itemTypeID) + "'";
+ Zotero.ItemTypes.getName(itemTypeID) + "'";
if (loadIn) {
Zotero.debug(msg + " -- ignoring value '" + value + "'", 2);