allow null properties coming from objects
[Evergreen.git] / Open-ILS / web / js / dojo / fieldmapper / hash.js
index c186dfa..6f82e57 100644 (file)
@@ -29,10 +29,10 @@ if(!dojo._hasResource['fieldmapper.hash']){
                return this;
        }
 
-       function _toHash () {
+       function _toHash (includeNulls) {
                var _hash = {};
                for ( var i=0; i < this._fields.length; i++) {
-                       if (this[this._fields[i]]() != null)
+                       if (includeNulls || this[this._fields[i]]() != null)
                                _hash[this._fields[i]] = '' + this[this._fields[i]]();
                }
                return _hash;