From 76c5dbdffe0a8160e6cee8537aa806b993e67640 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 15 Aug 2011 15:34:07 -0400 Subject: [PATCH] LP#820409 fix org unit admin UI This reverts part of 17e659eec3e23caf5d301b33aa5019b672ecd0e8, which was tightening checks against null and '' to avoid implicit type-casting. This line var modified_ou = new aou().fromStoreItem( current_ou ); was producing a fieldmapper object where certain fields were being set to contain the string "undefined" rather than a null. The update method would take isdeleted == "undefined" as True. Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js index df8b73bd14..006bd09067 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js +++ b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js @@ -223,7 +223,7 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){ //** FROM HASH **/ function _fromHash (_hash) { for ( var i=0; i < this._fields.length; i++) { - if (_hash[this._fields[i]] !== null) + if (_hash[this._fields[i]] != null) this[this._fields[i]]( _hash[this._fields[i]] ); } return this; @@ -233,8 +233,8 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){ var _hash = {}; var i; for (i=0; i < this._fields.length; i++) { - if (includeNulls || this[this._fields[i]]() !== null) { - if (this[this._fields[i]]() === null) + if (includeNulls || this[this._fields[i]]() != null) { + if (this[this._fields[i]]() == null) _hash[this._fields[i]] = null; else _hash[this._fields[i]] = '' + this[this._fields[i]](); -- 2.11.0