From 19a839330217a3f03568057e18018e6bb85b3c90 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 --- 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 ); -- 2.39.5