Merge pull request #683 from aurimasv/setValue-base_fields

Allow setting item field value via base field
This commit is contained in:
Dan Stillman 2015-03-26 20:33:54 -04:00
commit 21ad09112c

View file

@ -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;