From: Thomas Berezansky Date: Sat, 2 Jul 2011 22:50:27 +0000 (-0400) Subject: Fix checkout on alternate patron barcode X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=973aaee8be09a47613b5fb0f65deb44df7379ac4;p=evergreen%2Ftadl.git Fix checkout on alternate patron barcode Specifically, when a non-primary patron barcode is used. Such as via SIP2. NOTE: This does not change the behavior of inactive cards, nor will stock Evergreen usage produce a situation where this fix comes into play. --miker Signed-off-by: Thomas Berezansky Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 1479c1f0b6..559dc22296 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -752,9 +752,12 @@ sub mk_env { my $card = $e->search_actor_card({barcode => $self->patron_barcode})->[0] or return $self->bail_on_events(OpenILS::Event->new('ACTOR_USER_NOT_FOUND')); - $patron = $e->search_actor_user([{card => $card->id}, $flesh])->[0] + $patron = $e->retrieve_actor_user($card->usr) or return $self->bail_on_events(OpenILS::Event->new('ACTOR_USER_NOT_FOUND')); + # Use the card we looked up, not the patron's primary, for card active checks + $patron->card($card); + } else { if( my $copy = $self->copy ) {