From 0de27656b981a4360c1445fb30dcdab1d4a85cf6 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 29 Apr 2025 15:37:19 +0000 Subject: [PATCH] Bug 39777: Use cardnumber OR authenticated user cardnumber Test plan: 1) Apply the 'rollback tests' patch to reinstate the testing of the behavior if a cardnumber is missing (and a user is authenticated) 2) Run tests (they should fail): prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t 3) Apply this patch. Repeat 2) They should pass. --- Koha/ILL/Request/Workflow/HistoryCheck.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/ILL/Request/Workflow/HistoryCheck.pm b/Koha/ILL/Request/Workflow/HistoryCheck.pm index 818f2f4c742..b8f7fb55d14 100644 --- a/Koha/ILL/Request/Workflow/HistoryCheck.pm +++ b/Koha/ILL/Request/Workflow/HistoryCheck.pm @@ -193,7 +193,8 @@ sub _find_matching_requests { @existing_id_fields = grep { $_ eq 'pubmedid' } @existing_id_fields; } - my $patron = Koha::Patrons->find( { cardnumber => $self->{metadata}->{cardnumber} } ); + my $patron = Koha::Patrons->find( + { cardnumber => $self->{metadata}->{cardnumber} || C4::Context->userenv->{'cardnumber'} } ); return 0 unless $patron; -- 2.39.5