From: Jason Stephenson Date: Tue, 18 Aug 2020 12:45:07 +0000 (-0400) Subject: LP 1889628: Use Workstation in SIP Username Lookup X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=770c8820d92b782ad29b7493103df710357a5636;p=working%2FEvergreen.git 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 --- 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.