store actual nulls instead of stringified "null"
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 May 2008 02:41:36 +0000 (02:41 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 May 2008 02:41:36 +0000 (02:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9568 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/fieldmapper/hash.js

index 6f82e57..e401a42 100644 (file)
@@ -32,8 +32,11 @@ if(!dojo._hasResource['fieldmapper.hash']){
        function _toHash (includeNulls) {
                var _hash = {};
                for ( var i=0; i < this._fields.length; i++) {
-                       if (includeNulls || this[this._fields[i]]() != null)
-                               _hash[this._fields[i]] = '' + this[this._fields[i]]();
+                       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]]();
                }
                return _hash;
        }