lp 1844365 patron edit page stat cat persisting old data user/mrisher/lp1844365-edit-patron-stat-cat-persisting
authorMike Risher <mrisher@catalyte.io>
Mon, 24 Feb 2020 23:05:25 +0000 (23:05 +0000)
committerMike Risher <mrisher@catalyte.io>
Mon, 24 Feb 2020 23:05:25 +0000 (23:05 +0000)
Fix the bug on the patron edit page where old stat cat data is
persisting when one does a new patron search and loads a patron
with no stat cats.

Signed-off-by: Mike Risher <mrisher@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/app.js

Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index a886195..0866880 100644 (file)
@@ -611,9 +611,11 @@ function($scope , $location , egCore , egConfirmDialog , egUser , patronSvc , $u
        ['$scope','$q','$routeParams','$timeout','$window','$location','egCore','ngToast',
        '$filter','egUser', 'patronSvc','egGridDataProvider','$document','bucketSvc',
        'egPatronMerge','egProgressDialog','$controller','$interpolate','$uibModal',
+       'patronRegSvc',
 function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore , ngToast,
          $filter,  egUser,  patronSvc , egGridDataProvider , $document , bucketSvc,
-        egPatronMerge , egProgressDialog , $controller , $interpolate , $uibModal) {
+        egPatronMerge , egProgressDialog , $controller , $interpolate , $uibModal,
+        patronRegSvc ) {
 
     angular.extend(this, $controller('BasePatronSearchCtrl', {$scope : $scope}));
     $scope.initTab('search');
@@ -625,6 +627,9 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore ,
         selectedItems : function() { return [] }
     }
 
+    // reset the stat_cats or there's a risk previous patron's data data will persist
+    patronRegSvc.stat_cat_entry_maps = {};
+
     $scope.bucketSvc = bucketSvc;
     $scope.bucketSvc.fetchUserBuckets();
     $scope.addToBucket = function(item, data, recs) {