LP#1452950 Stat cat maps store values, not links
authorBill Erickson <berickxx@gmail.com>
Fri, 22 Jan 2016 03:21:15 +0000 (22:21 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 25 Feb 2016 22:32:00 +0000 (17:32 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index d9dc78f..8e128ec 100644 (file)
@@ -499,7 +499,7 @@ angular.module('egCoreMod')
             var entry;
             angular.forEach(service.stat_cats, function(cat) {
                 angular.forEach(cat.entries(), function(ent) {
-                    if (ent.id() == map.stat_cat_entry)
+                    if (ent.value() == map.stat_cat_entry)
                         entry = ent;
                 });
             });
@@ -619,7 +619,7 @@ angular.module('egCoreMod')
             if (existing) { // we have a mapping
                 // if the existing mapping matches the new one,
                 // there' nothing left to do
-                if (existing.stat_cat_entry() == entry.id()) return;
+                if (existing.stat_cat_entry() == entry.value()) return;
 
                 // mappings differ.  delete the old one and create
                 // a new one below.
@@ -630,7 +630,7 @@ angular.module('egCoreMod')
             newmap.target_usr(patron.id());
             newmap.isnew(true);
             newmap.stat_cat(entry.stat_cat());
-            newmap.stat_cat_entry(entry.id());
+            newmap.stat_cat_entry(entry.value());
             patron.stat_cat_entries().push(newmap);
         });