From f6323ee5351a6801321c0938690344f04aef6c54 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 15 Jun 2020 12:26:14 -0400 Subject: [PATCH] Bug 25761: Implementation of too_many_overdue has unintended consequences Bug 24449 implemented the too_many_overdue SIP flag ( position 6 of the patron status flags ). This has had unintended consequences as many library use SIP2 for validation to eresource vendors ( Overdrive, Hoopla, etc ), but do not want overdue checkouts to block the use of these resources. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Find a patron with overdue items 4) Run a SIP2 patron information request 5) Note the "too many overdue" flag is set 6) Set the new SIP config option "disable_too_many_overdue" for the account you used for testing 7) Restart the SIP server 8) Run the same patron information request 9) Notice the "too many overdue" flag is no longer set! Signed-off-by: Martin Renvoize Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Jonathan Druart --- C4/SIP/Sip/MsgType.pm | 10 ++++++---- etc/SIPconfig.xml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index e5c2b9edbc..c297865c50 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -433,7 +433,7 @@ sub build_patron_status { $password_rc = $patron->check_password($patron_pwd); } - $resp .= patron_status_string($patron); + $resp .= patron_status_string( $patron, $server ); $resp .= $lang . timestamp(); if ( defined $server->{account}->{ae_field_template} ) { $resp .= add_field( FID_PERSONAL_NAME, $patron->format( $server->{account}->{ae_field_template}, $server ) ); @@ -969,7 +969,7 @@ sub handle_patron_info { $resp = (PATRON_INFO_RESP); if ($patron) { $patron->update_lastseen(); - $resp .= patron_status_string($patron); + $resp .= patron_status_string( $patron, $server ); $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language; $resp .= timestamp(); @@ -1337,7 +1337,7 @@ sub handle_patron_enable { # Don't enable the patron if there was an invalid password $status = $patron->enable; } - $resp .= patron_status_string($patron); + $resp .= patron_status_string( $patron, $server ); $resp .= $patron->language . timestamp(); $resp .= add_field( FID_PATRON_ID, $patron->id, $server ); @@ -1663,6 +1663,8 @@ sub send_acs_status { # sub patron_status_string { my $patron = shift; + my $server = shift; + my $patron_status; siplog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); @@ -1674,7 +1676,7 @@ sub patron_status_string { denied( $patron->hold_ok ), boolspace( $patron->card_lost ), boolspace( $patron->too_many_charged ), - boolspace( $patron->too_many_overdue ), + $server->{account}->{disable_too_many_overdue} ? q{ } : boolspace( $patron->too_many_overdue ), boolspace( $patron->too_many_renewal ), boolspace( $patron->too_many_claim_return ), boolspace( $patron->too_many_lost ), diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml index 43f34ee05b..eb278e622e 100644 --- a/etc/SIPconfig.xml +++ b/etc/SIPconfig.xml @@ -60,6 +60,7 @@ da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" hide_fields="BD,BE,BF,PB" + disable_too_many_overdue="1" register_id='' holds_block_checkin="0"> -- 2.39.5