[open-ils-commits] r19862 - branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Mar 25 13:31:33 EDT 2011


Author: phasefx
Date: 2011-03-25 13:31:29 -0400 (Fri, 25 Mar 2011)
New Revision: 19862

Modified:
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Log:
data.lookup was broken for cases where data.list[key] didn't exist for a given key

Signed-off-by: Jason Etheridge <jason at esilibrary.com>


Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2011-03-25 17:31:14 UTC (rev 19861)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2011-03-25 17:31:29 UTC (rev 19862)
@@ -186,17 +186,20 @@
                 break;
                 case 'actsc':
                     found = obj.network.simple_request('FM_ACTSC_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : value } }]);
-                    if (typeof found.ilsevent != 'undefined') throw(found);
+                    if (typeof found.ilsevent != 'undefined') throw(js2JSON(found));
                     found = found[0];
                 break;
                 default: return undefined; break;
             }
             if (typeof found.ilsevent != 'undefined') throw(found);
             if (!obj.hash[key]) obj.hash[key] = {};
-            obj.hash[key][value] = found; obj.list[key].push( found ); obj.stash('hash','list');
+            obj.hash[key][value] = found;
+            if (!obj.list[key]) obj.list[key] = [];
+            obj.list[key].push( found );
+            obj.stash('hash','list');
             return found;
         } catch(E) {
-            this.error.sdump('D_ERROR','Error in OpenILS.data.lookup('+key+','+value+'): ' + js2JSON(E) );
+            alert('Error in OpenILS.data.lookup('+key+','+value+'): ' + E );
             return undefined;
         }
     },



More information about the open-ils-commits mailing list