commit e732d6350be6a8d0589878113163b09b2ec5442c parent 7519287fa8510cfff6a7243250a537aae75d0dbe Author: Aurimas Vinckevicius <aurimas.dev@gmail.com> Date: Tue, 24 Mar 2015 02:04:54 -0500 Allow setting item field value via base field Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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;