www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 21ad09112ccede98b46147dc8e485063f85cfb2d
parent c795cf5d82414912d877b60c4dd372f3e53a05e5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 26 Mar 2015 20:33:54 -0400

Merge pull request #683 from aurimasv/setValue-base_fields

Allow setting item field value via base field
Diffstat:
Mchrome/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;