From: Jason Etheridge Date: Wed, 18 Jul 2018 05:41:59 +0000 (-0400) Subject: 7-retrieve-patron-fails-to-load-patron-record X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d7d60d004b869a212b57f1287c822bc5c1efe0b6;p=working%2FEvergreen.git 7-retrieve-patron-fails-to-load-patron-record give the user_request.view permission some parity with VIEW_USER And some defensive programming if trying to create a request in the user already known context without adequate permission Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index d8e77e2145..de5ddab489 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3506,7 +3506,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + @@ -6669,7 +6669,7 @@ SELECT usr, - + diff --git a/Open-ILS/web/js/ui/default/staff/acq/services/requests.js b/Open-ILS/web/js/ui/default/staff/acq/services/requests.js index a9fbbdc4fe..f44e9d9d71 100644 --- a/Open-ILS/web/js/ui/default/staff/acq/services/requests.js +++ b/Open-ILS/web/js/ui/default/staff/acq/services/requests.js @@ -342,30 +342,32 @@ function($uibModal , $q , egCore , egOrg , ngToast) { }, { atomic : true } ).then(function(users) { - var usr = egCore.idl.toHash(users[0]); - aur_obj.usr = usr.id; - aur_obj.pickup_lib = egCore.idl.toHash( - egOrg.get(usr.home_ou.id) - ); - aur_obj.phone_notify = usr.day_phone; - angular.forEach(usr.settings, function(s) { - if (s.name == 'opac.hold_notify') { - if (s.value.match('phone')) { - extra.phone_notify = true; + if (users.length > 0) { + var usr = egCore.idl.toHash(users[0]); + aur_obj.usr = usr.id; + aur_obj.pickup_lib = egCore.idl.toHash( + egOrg.get(usr.home_ou.id) + ); + aur_obj.phone_notify = usr.day_phone; + angular.forEach(usr.settings, function(s) { + if (s.name == 'opac.hold_notify') { + if (s.value.match('phone')) { + extra.phone_notify = true; + } + if (s.value.match('email')) { + aur_obj.email_notify = true; + } } - if (s.value.match('email')) { - aur_obj.email_notify = true; + if (s.name == 'opac.default_phone') { + aur_obj.phone_notify = s.value.replace(/^"/,'').replace(/"$/,''); } - } - if (s.name == 'opac.default_phone') { - aur_obj.phone_notify = s.value.replace(/^"/,'').replace(/"$/,''); - } - if (s.name == 'opac.default_pickup_location') { - aur_obj.pickup_lib = egCore.idl.toHash( - egOrg.get(s.value) - ); - } - }); + if (s.name == 'opac.default_pickup_location') { + aur_obj.pickup_lib = egCore.idl.toHash( + egOrg.get(s.value) + ); + } + }); + } return { 'request' : aur_obj, 'extra' : extra }; }); } else {