From 72476c874d540738aff44b1a714d4c068b4c756c Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Mon, 10 Jul 2017 16:47:26 -0400 Subject: [PATCH] LP#1702756 - WebStaff fix for bug that was introduced by 997e2772 While addressing LP#1696495 fixed the bug of user settings caching improperly between patron edits, it caused an issue when the regctl was loaded for registering a new patron. This corrects that. Signed-off by: Cesar Velez Signed-off-by: Josh Stompro Signed-off-by: Galen Charlton --- .../js/ui/default/staff/circ/patron/regctl.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 4e53fde217..d0dcca8549 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -581,7 +581,7 @@ angular.module('egCoreMod') service.init_patron = function(current) { if (!current) - return service.init_new_patron(); + return $q.when(service.init_new_patron()); service.patron = current; return $q.when(service.init_existing_patron(current)); @@ -656,6 +656,7 @@ angular.module('egCoreMod') }); service.patron = patron; + return patron; } service.init_new_patron = function() { @@ -1180,13 +1181,12 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , patronRegSvc.init(), - ]).then(function(){ return patronRegSvc.init_patron(patronSvc ? patronSvc.current : null) }) - .then(patronRegSvc.get_user_settings) - .then(function() { + ]).then(function(){ return patronRegSvc.init_patron(patronSvc ? patronSvc.current : patronRegSvc.patron ) }) + .then(function(patron) { // called after initTab and patronRegSvc.init have completed // in standalone mode, we have no patronSvc var prs = patronRegSvc; - $scope.patron = prs.patron; + $scope.patron = patron; $scope.field_doc = prs.field_doc; $scope.edit_profiles = prs.edit_profiles; $scope.ident_types = prs.ident_types; @@ -1206,14 +1206,14 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , prs.user_settings = {}; extract_hold_notify(); + if ($scope.patron.isnew) + set_new_patron_defaults(prs); + $scope.handle_home_org_changed(); if ($scope.org_settings['ui.patron.edit.default_suggested']) $scope.edit_passthru.vis_level = 1; - if ($scope.patron.isnew) - set_new_patron_defaults(prs); - // Stat cats are fetched from open-ils.storage, where 't'==1 $scope.hasRequiredStatCat = prs.stat_cats.filter( function(cat) {return cat.required() == 1} ).length > 0; -- 2.43.2