From 770c8820d92b782ad29b7493103df710357a5636 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 18 Aug 2020 08:45:07 -0400 Subject: [PATCH] LP 1889628: Use Workstation in SIP Username Lookup Following a suggestion from Bill Erickson, the SIP->get_ou_settings() function now uses the workstation org. unit of the logged in SIP2 account if it is set. The home_ou is used as a fallback. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/SIP.pm | 6 +++++- docs/RELEASE_NOTES_NEXT/SIP/allow_usrname_in_patron_id.adoc | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm index 5393765994..c1c7a764c0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm @@ -245,7 +245,11 @@ sub get_ou_setting { my $self = shift; my $setting = shift; my $sess = $self->fetch_session; - return $U->ou_ancestor_setting_value($sess->home_ou, $setting); + my $ou = (ref($sess->home_ou)) ? $sess->home_ou->id : $sess->home_ou; + if ($sess->ws_ou) { + $ou = (ref($sess->ws_ou)) ? $sess->ws_ou->id : $sess->ws_ou; + } + return $U->ou_ancestor_setting_value($ou, $setting); } sub get_barcode_regex { diff --git a/docs/RELEASE_NOTES_NEXT/SIP/allow_usrname_in_patron_id.adoc b/docs/RELEASE_NOTES_NEXT/SIP/allow_usrname_in_patron_id.adoc index c8d1e1d52e..671bf9d586 100644 --- a/docs/RELEASE_NOTES_NEXT/SIP/allow_usrname_in_patron_id.adoc +++ b/docs/RELEASE_NOTES_NEXT/SIP/allow_usrname_in_patron_id.adoc @@ -8,6 +8,6 @@ username over their barcode. The new feature determines if the value in the Patron ID field is a barcode or username by comparing the field value against the -`opac.barcode_regex` setting for the home organizational unit of the -logged in SIP2 account as configured in the oils_sip.xml file. This -is similar to what the OPAC does when a patron logs in. +`opac.barcode_regex` setting for the organizational unit of the logged +in SIP2 account as configured in the oils_sip.xml file. This is +similar to what the OPAC does when a patron logs in. -- 2.43.2