From e732d6350be6a8d0589878113163b09b2ec5442c Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Tue, 24 Mar 2015 02:04:54 -0500 Subject: [PATCH] Allow setting item field value via base field --- chrome/content/zotero/xpcom/data/item.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 2563840a9..68e488bc5 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -804,6 +804,9 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { value = false; } + // Make sure to use type-specific field ID if available + fieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(this.itemTypeID, fieldID) || fieldID; + if (value !== false && !Zotero.ItemFields.isValidForType(fieldID, this.itemTypeID)) { var msg = "'" + field + "' is not a valid field for type " + this.itemTypeID;