Bugzilla – Attachment 117797 Details for
Bug 27860
Bad KohaAdminEmailAddress breaks patron self registration and password reset feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27860: Fix self-registration if messages with incorrect email are inqueued
Bug-27860-Fix-self-registration-if-messages-with-i.patch (text/plain), 2.30 KB, created by
Jonathan Druart
on 2021-03-05 09:18:40 UTC
(
hide
)
Description:
Bug 27860: Fix self-registration if messages with incorrect email are inqueued
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-03-05 09:18:40 UTC
Size:
2.30 KB
patch
obsolete
>From 1d36a8180d066696503ef22b1a4a63084f6edf09 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 5 Mar 2021 10:04:14 +0100 >Subject: [PATCH] Bug 27860: Fix self-registration if messages with incorrect > email are inqueued > >If the pref KohaAdminEmailAddress was not set correctly (invalid email) >and has been used to generate message, the message_queue table can contain >some messages that are not sent (pending) and will be processed each >time a new self-reg is done. >The PatronSelfRegistrationVerifyByEmail feature must send only the >notice we just generated, not the whole pending queue. > >Test plan: >1. Do not apply the patches >2. Set KohaAdminEmailAddress to an invalid email (root@localhost for >instance) >3. Turn on PatronSelfRegistrationVerifyByEmail >4. Self-reg a patron >5. Boom (that must be fixed on a separate bug report) >6. Set KohaAdminEmailAddress to a valid email (root@example.org) >7. Self-reg a patron >8. Still Boom! (because it's processing the first invalid email) >9. Apply the patches, restart_all >10. Self-reg a patron >=> The email is sent! >Notice the change in DB, the first email is still there with status >"pending" and second email is sent! > >QA: at step 10. TODO first email must be 'failed' (highlight in tests) >--- > opac/opac-memberentry.pl | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 9e359521ac..dbfd6f83dd 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -197,7 +197,7 @@ if ( $action eq 'create' ) { > }, > ); > >- C4::Letters::EnqueueLetter( >+ my $message_id = C4::Letters::EnqueueLetter( > { > letter => $letter, > message_transport_type => 'email', >@@ -206,9 +206,7 @@ if ( $action eq 'create' ) { > C4::Context->preference('KohaAdminEmailAddress'), > } > ); >- my $num_letters_attempted = C4::Letters::SendQueuedMessages( { >- letter_code => 'OPAC_REG_VERIFY' >- } ); >+ C4::Letters::SendQueuedMessages({ message_id => $message_id }); > } > else { > ( $template, $borrowernumber, $cookie ) = get_template_and_user( >-- >2.20.1
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 27860
:
117796
|
117797
|
117798
|
117931
|
117932
|
117933
|
118201
|
118202
|
118203