Bugzilla – Attachment 155326 Details for
Bug 34731
C4::Letters::SendQueuedMessages can be triggered with an undef message_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34731: Don't call SendQueuedMessages if message_id is bad
Bug-34731-Dont-call-SendQueuedMessages-if-messagei.patch (text/plain), 9.28 KB, created by
Kyle M Hall (khall)
on 2023-09-07 15:52:43 UTC
(
hide
)
Description:
Bug 34731: Don't call SendQueuedMessages if message_id is bad
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-07 15:52:43 UTC
Size:
9.28 KB
patch
obsolete
>From 1801e2182aed02360aaec1abb86ad76e487c5eef Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 7 Sep 2023 11:15:25 -0400 >Subject: [PATCH] Bug 34731: Don't call SendQueuedMessages if message_id is bad > >--- > C4/Auth_with_ldap.pm | 2 +- > C4/Auth_with_shibboleth.pm | 2 +- > Koha/Patron.pm | 2 +- > Koha/Patron/Password/Recovery.pm | 3 +-- > Koha/REST/V1/TwoFactorAuth.pm | 2 +- > Koha/Ticket.pm | 7 +++---- > basket/sendbasket.pl | 2 +- > members/boraccount.pl | 4 ++-- > members/memberentry.pl | 2 +- > opac/opac-memberentry.pl | 4 ++-- > opac/opac-registration-verify.pl | 2 +- > opac/opac-sendbasket.pl | 2 +- > opac/opac-sendshelf.pl | 2 +- > pos/pay.pl | 2 +- > virtualshelves/sendshelf.pl | 2 +- > 15 files changed, 19 insertions(+), 21 deletions(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index f13dbdcf8e8..422a59a45b3 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -261,7 +261,7 @@ sub checkpw_ldap { > } > ); > >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > } > } else { >diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm >index 364fd774b1f..67552f3c89d 100644 >--- a/C4/Auth_with_shibboleth.pm >+++ b/C4/Auth_with_shibboleth.pm >@@ -169,7 +169,7 @@ sub _autocreate { > message_transport_type => 'email' > } > ); >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > } > return ( 1, $patron->cardnumber, $patron->userid ); >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 6937ea904a7..1c9a5188313 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -932,7 +932,7 @@ sub set_password { > message_transport_type => 'email' > } > ); >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > } > } >diff --git a/Koha/Patron/Password/Recovery.pm b/Koha/Patron/Password/Recovery.pm >index 1e462be3683..879058488e3 100644 >--- a/Koha/Patron/Password/Recovery.pm >+++ b/Koha/Patron/Password/Recovery.pm >@@ -158,8 +158,7 @@ sub SendPasswordRecoveryEmail { > } > ); > >- my $num_letters_attempted = >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ my $num_letters_attempted = C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > return ($num_letters_attempted > 0); > } >diff --git a/Koha/REST/V1/TwoFactorAuth.pm b/Koha/REST/V1/TwoFactorAuth.pm >index 9681fca16d4..b999371e10d 100644 >--- a/Koha/REST/V1/TwoFactorAuth.pm >+++ b/Koha/REST/V1/TwoFactorAuth.pm >@@ -62,7 +62,7 @@ sub send_otp_token { > message_transport_type => 'email' > } > ); >- C4::Letters::SendQueuedMessages({message_id => $message_id}); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > my $message = C4::Letters::GetMessage($message_id); > >diff --git a/Koha/Ticket.pm b/Koha/Ticket.pm >index bec743b7839..83b84bc97e3 100644 >--- a/Koha/Ticket.pm >+++ b/Koha/Ticket.pm >@@ -131,8 +131,8 @@ sub store { > borrowernumber => $self->reporter_id, > } > ); >- C4::Letters::SendQueuedMessages( >- { message_id => $acknowledgement_message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $acknowledgement_message_id } ) >+ if $acknowledgement_message_id; > } > > # Notify cataloger by email >@@ -156,8 +156,7 @@ sub store { > reply_address => $self->reporter->notice_email_address, > } > ); >- C4::Letters::SendQueuedMessages( >- { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > } > } >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 3d5438fb427..e863497d32b 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -111,7 +111,7 @@ if ($email_add) { > } > ); > >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > $template->param( SENT => 1 ); > } >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 72725b57f15..5398f28ea68 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -207,8 +207,8 @@ if ( $action eq 'send_receipt' ) { > message_transport_type => 'email', > } > ); >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >- $receipt_sent = 1; >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; >+ $receipt_sent = $message_id ? 1 : -1; > } > else { > $receipt_sent = -1; >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 64d9aa2aa7b..70841759d7c 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -450,7 +450,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ > message_transport_type => 'email' > } > ); >- SendQueuedMessages({ message_id => $message_id }); >+ SendQueuedMessages( { message_id => $message_id } ) if $message_id; > }; > if ($@) { > $template->param( error_alert => $@ ); >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index d18e5f542b6..ab99cb4e8cd 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -211,7 +211,7 @@ if ( $action eq 'create' ) { > C4::Context->preference('KohaAdminEmailAddress'), > } > ); >- C4::Letters::SendQueuedMessages({ message_id => $message_id }); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > } > else { > $borrower{password} ||= Koha::AuthUtils::generate_password(Koha::Patron::Categories->find($borrower{categorycode})); >@@ -279,7 +279,7 @@ if ( $action eq 'create' ) { > message_transport_type => 'email' > } > ); >- SendQueuedMessages({ message_id => $message_id }); >+ SendQueuedMessages( { message_id => $message_id } ) if $message_id; > }; > } > } >diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl >index 5cb30239daa..60a004e18fd 100755 >--- a/opac/opac-registration-verify.pl >+++ b/opac/opac-registration-verify.pl >@@ -120,7 +120,7 @@ if ( > message_transport_type => 'email' > } > ); >- SendQueuedMessages({ message_id => $message_id }); >+ SendQueuedMessages( { message_id => $message_id } ) if $message_id; > }; > } > } >diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index ae0ec81e1c2..d0ff9fc53a6 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -110,7 +110,7 @@ if ( $email_add ) { > } > ); > >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > $template->param( SENT => 1 ); > } >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index a90d2ca5f4f..e08b474cb15 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -118,7 +118,7 @@ if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { > } > ); > >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > $template->param( SENT => 1 ); > } >diff --git a/pos/pay.pl b/pos/pay.pl >index 871ffd6c19e..495ffcdeec3 100755 >--- a/pos/pay.pl >+++ b/pos/pay.pl >@@ -116,7 +116,7 @@ if ( $action eq 'send' ) { > ); > > # Send immediately >- SendQueuedMessages( { message_id => $message_id } ); >+ SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > # Set variables for template to allow printing still > $template->param( >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index 3a2738c2d84..e50f3c3cd35 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -117,7 +117,7 @@ if ($to_address) { > } > ); > >- C4::Letters::SendQueuedMessages( { message_id => $message_id } ); >+ C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; > > $template->param( SENT => 1 ); > } >-- >2.30.2
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 34731
:
155325
|
155326
|
155327
|
155459
|
155460
|
155461
|
155478
|
155479
|
155480
|
155481
|
158178
|
158179
|
158180