LP1853363 Followup: Permit Lost Cards user/jboyer/lp1853363_followup
authorJason Boyer <JBoyer@eoli.info>
Mon, 9 Dec 2019 14:21:24 +0000 (09:21 -0500)
committerJason Boyer <JBoyer@eoli.info>
Mon, 9 Dec 2019 14:21:24 +0000 (09:21 -0500)
There is a short circuit check for the active
field on the user's card, forcing the Patron Status
Response field to return charge, renewal, recall,
and hold privileges denied and returns a minimal set
of patron information. This followup commit will
allow the patron_status_always_permit_loans to also
override this.

I should note that I don't personally think that this
is a good idea, (lost card is lost) but in the interst
of discussion and allowing libraries to choose what
they feel works best for their users, here it is.

Signed-off-by: Jason Boyer <JBoyer@eoli.info>
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm

index 16cff51..db61a38 100644 (file)
@@ -87,7 +87,7 @@ sub new {
 
         my $card = $e->search_actor_card([{barcode => $patron_id}, $usr_flesh])->[0];
 
-        if(!$card or !$U->is_true($card->active)) {
+        if(!$card or (!$U->is_true($card->active) && !$self->patron_status_always_permit_loans_set())) {
             syslog("LOG_WARNING", "No such patron barcode: $patron_id");
             return undef;
         }