Bugzilla – Attachment 62369 Details for
Bug 18457
process_message_queue.pl will die if a patron has no sms_provider_id set but sms via email is enabled for that patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18457 - process_message_queue.pl will die if a patron has no sms_provider_id set but sms via email is enabled for that patron
Bug-18457---processmessagequeuepl-will-die-if-a-pa.patch (text/plain), 1.83 KB, created by
Kyle M Hall (khall)
on 2017-04-19 14:05:12 UTC
(
hide
)
Description:
Bug 18457 - process_message_queue.pl will die if a patron has no sms_provider_id set but sms via email is enabled for that patron
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-04-19 14:05:12 UTC
Size:
1.83 KB
patch
obsolete
>From cdca1fd13816447580c12b5e39fe8012c2a9238a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 19 Apr 2017 09:52:38 -0400 >Subject: [PATCH] Bug 18457 - process_message_queue.pl will die if a patron has > no sms_provider_id set but sms via email is enabled for that patron > >If SMS via Email is enabled, and a patron has opted for SMS messages, but has not selected a service provider, the cronjob will die with the error >Can't call method "domain" on an undefined value at /usr/share/koha/lib/C4/Letters.pm line 1055. >This will cause all messages that come after the error to not be sent! > >Test Plan: >1) Enable SMS via Email >2) Enable SMS for a patron, but don't set a provider >3) Perform an action that will trigger an sms message to go into > the holds queue ( item due, item checkout, etc ) >4) Run process_message_queue.pl, note the error >5) Apply the patch >4) Run process_message_queue.pl, no error this time! >--- > C4/Letters.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index cf13bae..f0a0711 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1050,6 +1050,10 @@ sub SendQueuedMessages { > if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) { > my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} ); > my $sms_provider = Koha::SMS::Providers->find( $member->{'sms_provider_id'} ); >+ unless ( $sms_provider ) { >+ warn "Patron %s has no sms provider id set!" if $params->{'verbose'} or $debug; >+ next MESSAGE; >+ } > $message->{to_address} .= '@' . $sms_provider->domain(); > _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} ); > } else { >-- >2.10.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 18457
:
62369
|
62554
|
62580
|
62619
|
62620