From 82c23565be3824f893fce881247399122566dbc6 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 20 Jun 2025 10:30:17 +0000 Subject: [PATCH] Bug 40171: Return fail if no transports for patron Test plan, k-t-d, don't apply patches yet: 1) Enable ILLModule 2) Create a new ill request at: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 3) Pick any type and any library, pick '42' for patron. This is the 'koha' user. 4) Create the request, click 'Send notice to patron'. Pick any template. Notice nothing is shown on the UI. 5) Apply patches. Repeat. Notice you get the message: "The requested notice was NOT queued for delivery by email, SMS". 6) Edit the 'koha' patron and tick the following boxes on 'Patron messaging preferences': - Interlibrary loan ready - Interlibrary loan unavailable 7) Go back to the request and click 'Send notice to patron' and pick any option again. Notice now you get a success message. Signed-off-by: David Nind Signed-off-by: Lisette Scheer Signed-off-by: Lucas Gass (cherry picked from commit 4bd5b58cd9a93dc136f9d4be90687ec77615d3c2) Signed-off-by: Paul Derscheid --- Koha/ILL/Request.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 9b151e3924..4c8453d4dd 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1776,6 +1776,8 @@ sub send_patron_notice { ); my @transports = keys %{ $borrower_preferences->{transports} }; + return { result => { fail => [ 'email', 'sms' ], success => [] } } unless @transports; + # Notice should come from the library where the request was placed, # not the patrons home library my $branch = Koha::Libraries->find( $self->branchcode );