Bugzilla – Attachment 63983 Details for
Bug 18478
Some notices sent via SMS gateway fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[16.11.x Rebase] Bug 18478 - Some notices sent via SMS gateway fail
1611x-Rebase-Bug-18478---Some-notices-sent-via-SMS.patch (text/plain), 2.54 KB, created by
Nick Clemens (kidclamp)
on 2017-06-05 18:45:01 UTC
(
hide
)
Description:
[16.11.x Rebase] Bug 18478 - Some notices sent via SMS gateway fail
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-06-05 18:45:01 UTC
Size:
2.54 KB
patch
obsolete
>From b8560b83ecfe1ff879de551eb41b558f3cb9df51 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 17 May 2017 12:54:44 -0400 >Subject: [PATCH] [16.11.x Rebase] Bug 18478 - Some notices sent via SMS > gateway fail > >It seems that for HOLD and DUE (and maybe more) notices we rely on >C4::Letters::SendQueuedMessages >to populate the correct address. > >This patch adjust that subroutine to correctly populate the field and/or >fail messages if no SMS provider available > >To test: > 1 - Define a messaging prefs for a patron to recieve hold notices via > SMS > 2 - Ensure you have defined an SMS message for 'HOLD' letter > 3 - Set an SMS alert number for patron > 4 - Set the SMS::Send driver to 'Email' > 5 - Fill a hold for the patron > 6 - Check the db and note the address is null > 7 - run process_message_queue.pl > 8 - Check db - address is null and message pending > 9 - Apply patch >10 - run process_message_queue >11 - Message to_address should be populated and message sent > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Letters.pm | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 86a2e55..c53c63e 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1049,9 +1049,17 @@ sub SendQueuedMessages { > my $sms_provider = Koha::SMS::Providers->find( $member->{'sms_provider_id'} ); > unless ( $sms_provider ) { > warn sprintf( "Patron %s has no sms provider id set!", $message->{'borrowernumber'} ) if $params->{'verbose'} or $debug; >+ _set_message_status( { message_id => $message->{'message_id'}, status => 'failed' } ); >+ next MESSAGE; >+ } >+ $message->{to_address} = $message->{to_address} ? $message->{to_address} : $member->{'smsalertnumber'}; >+ unless ( $message->{to_address} && $member->{'smsalertnumber'} ) { >+ _set_message_status( { message_id => $message->{'message_id'}, status => 'failed' } ); >+ warn sprintf( "No smsalertnumber found for patron %s!", $message->{'borrowernumber'} ) if $params->{'verbose'} or $debug; > next MESSAGE; > } > $message->{to_address} .= '@' . $sms_provider->domain(); >+ _update_message_to_address($message->{'message_id'},$message->{to_address}); > _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} ); > } else { > _send_message_by_sms( $message ); >-- >2.1.4
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 18478
:
63487
|
63488
|
63504
|
63505
|
63506
|
63674
|
63675
|
63734
|
63735
|
63736
|
63737
|
63738
| 63983 |
63984
|
63985