From c237340ffb7627ddceae28333b16f365a4c81e04 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Sun, 11 Jun 2017 12:21:23 +0000 Subject: [PATCH] Bug 15438 [Alternate Solution] - Checking out an on-hold item sends holder's borrowernumber in AF (screen message) field. Description: Let's say that 'Holding Patron' puts a hold on title 'ASDF'. If 'SIP Patron' then tries to check out ASDF, Holding Patron's card number appears in the AF (i.e. Screen Message) field. This only occurs if the hold has *not* yet been finalized -- If ASDF is waiting for Holding Patron, the screen message will read "Item is on hold shelf for another patron." The screen message containing only the Holding Patron's borrowernumber is confusing because a) It contains no context as to the nature of the number showing on the screen b) SIP devices work with borrower card numbers, so the number being returned has the wrong context. Furthermore, we're leaking patron information in a place where we probably would never check. Replicating the problem: Set up instance with two patrons, as well as a bib/item to put on hold/check out. Make sure that circ rules allow holds. Set up SIPconfig.xml to allow checkouts on the IP/port of your choice. Start SIP2. Make sure that authentication, checkin and check out work for the 'SIP Patron'. Ensure that AllowItemsOnHoldCheckout is set to "Don't Allow". In the steps to replicate, the Title/barcode of the item on hold/being checked out will be 'asdf'. The Holding Patron will be referred to as 'holder' and the checkout patron will be referred to as 'sipper'. Let's say that sipper's borrowernumber is 52. 1/ Place a biblio level hold for asdf, with holder as the holding patron. 2/ Start `sudo tail -f /var/log/syslog | grep sip` 3/ Attempt to check out asdf to sipper. You will see the sip checkout message '11...' followed by a '120...|AF52|...' sip checkout response. This indicates that the checkout has failed (which we would expect), and that the screen message is '52'. Example using ./misc/sip_cli_emulator.pl $ ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su staff -sp staff -l CPL --patron 23529001223636 --password 1234 --item 1234 -m checkout Attempting socket connection to 127.0.0.1:6001...connected! SEND: 9300CNstaff|COstaff|CPCPL| READ: 941 Trying 'checkout' SEND: 11YN20151229 05321120151229 053211AOCPL|AA23529001223636|AB1234|ACstaff|AD1234|BON|BIN| READ: 120NUN20151229 053211AOCPL|AA23529001223636|AB1234|AJTheories of human development :|AH|AF52|BLY|BV5.00|BHUSD|BT06| --- C4/SIP/ILS/Transaction/Checkout.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index 14a2b66..a3e5848 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -80,7 +80,7 @@ sub do_checkout { $self->screen_msg("Item was reserved for you."); } else { $self->screen_msg("Item is reserved for another patron upon return."); - # $noerror = 0; + $noerror = 0; } } elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { $self->screen_msg("Item already checked out to another patron. Please return item for check-in."); @@ -96,9 +96,11 @@ sub do_checkout { $noerror = 0; } } else { - $self->screen_msg($needsconfirmation->{$confirmation}); - $noerror = 0; - syslog('LOG_DEBUG', "Blocking checkout Reason:$confirmation"); + unless ( $self->screen_msg ) { + $self->screen_msg($needsconfirmation->{$confirmation}); + $noerror = 0; + syslog('LOG_DEBUG', "Blocking checkout Reason:$confirmation"); + } } } } -- 2.10.2