[Koha-bugs] [Bug 18570] Password recovery e-mail only sent after message queue is processed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 7 17:40:26 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18570

--- Comment #9 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 72499
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72499
Patch for bug 18570

Review of attachment 72499:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18570&attachment=72499)
-----------------------------------------------------------------

::: C4/Letters.pm
@@ +1080,5 @@
> +Messages from the `message_queue` table are matched on borrowernumber and letter_code='PASSWORD_RESET'
> +
> +=cut
> +
> +sub SendPasswordEmailFromQueue {

I believe this is the wrong way to do it. I think building a hash ref in
SendQueuedMessages and using the built hashref on the _get_unsent_messages call
would be better than introducing this, and this fails to handle how to send
messages.

After all, calling it with a borrower number and a letter code in the params
hash ref should be easy enough to add, and then you could simply tweak the
t/db_dependent/Letters.t test to test for the password reset case.

@@ +1299,4 @@
>      my @query_params = ('pending');
>      if ( ref $params ) {
>          if ( $params->{'message_transport_type'} ) {
> +            $statement .= ' AND mq.message_transport_type = ? ';

Not necessary, but okay. There is only one message_transport_type field.

@@ +1303,4 @@
>              push @query_params, $params->{'message_transport_type'};
>          }
>          if ( $params->{'borrowernumber'} ) {
> +            $statement .= ' AND mq.borrowernumber = ? ';

Not necessary, but okay. The LEFT JOIN makes sure the number is the same, and
there is only one borrowernumber in the SELECT list of the SQL statement.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list