Merge pull request #683 from aurimasv/setValue-base_fields
Allow setting item field value via base field
This commit is contained in:
commit
21ad09112c
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue