From f400d2a4a44bf169d87459de44ea2f8987a2e748 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 30 Oct 2021 14:39:55 -0400 Subject: [PATCH] Include item type name in field-not-valid-for-type error --- chrome/content/zotero/xpcom/data/item.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 0eceae03d9..813dcb0277 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -766,7 +766,8 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { fieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(itemTypeID, fieldID) || fieldID; if (value !== false && !Zotero.ItemFields.isValidForType(fieldID, itemTypeID)) { - var msg = "'" + field + "' is not a valid field for type " + itemTypeID; + let msg = "'" + field + "' is not a valid field for type '" + + Zotero.ItemFields.getName(itemTypeID) + "'"; if (loadIn) { Zotero.debug(msg + " -- ignoring value '" + value + "'", 2);