Bugzilla – Attachment 187799 Details for
Bug 39408
Cannot add patron via API if AutoEmailNewUser and WELCOME content blank
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39408: Don't attempt to send a message if one is not generated
Bug-39408-Dont-attempt-to-send-a-message-if-one-is.patch (text/plain), 1.97 KB, created by
Martin Renvoize (ashimema)
on 2025-10-13 08:39:04 UTC
(
hide
)
Description:
Bug 39408: Don't attempt to send a message if one is not generated
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-13 08:39:04 UTC
Size:
1.97 KB
patch
obsolete
>From 52fed7f42ac21f3bc04e989dd4d8080f9847651e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 21 Mar 2025 13:58:24 +0000 >Subject: [PATCH] Bug 39408: Don't attempt to send a message if one is not > generated > >The routine to create the message can return nothing if there is no content, >we should handle this case and not attempt to send. > >To test: >1 - Test plan from last patch >2 - Apply this patch >3 - POST to patron API again >4 - Success! > >Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > Koha/REST/V1/Patrons.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index b6d009c6437..7d733c10dc1 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -121,9 +121,8 @@ sub add { > module => 'members', > letter_code => 'WELCOME', > branchcode => $patron->branchcode, >- , >- lang => $patron->lang || 'default', >- tables => { >+ lang => $patron->lang || 'default', >+ tables => { > 'branches' => $patron->branchcode, > 'borrowers' => $patron->borrowernumber, > }, >@@ -139,7 +138,9 @@ sub add { > message_transport_type => 'email' > } > ); >- SendQueuedMessages( { message_id => $message_id } ); >+ >+ # Don't send a message if we didn't generate one for some reason >+ SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > } > } >-- >2.51.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39408
:
179613
|
179614
|
180255
|
180256
|
182165
|
182166
|
182167
|
187798
|
187799
|
187800
|
187827
|
187828
|
187829