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 <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
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 ) {