From 74d31a707b260ca30b1a3efe8d2bf81d2a9f6a1b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Nov 2013 14:54:36 +0100 Subject: [PATCH] [PASSED QA] Bug 11208: If no smsalertnumber is defined, the message is marked as failed For DUE message (and PREDUE, etc.) there are no check before sending the message to the message_queue table. This check avoids to try to send again and again the same message. Now it is marked as "failed". Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Without the patch a sms notice will remain as 'pending' forever. With the patch applied, the status is set to 'failed'. Passes all tests and QA script. --- C4/Letters.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 7125148..c78d01e 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -998,7 +998,12 @@ EOS sub _send_message_by_sms { my $message = shift or return; my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} ); - return unless $member->{'smsalertnumber'}; + + unless ( $member->{smsalertnumber} ) { + _set_message_status( { message_id => $message->{'message_id'}, + status => 'failed' } ); + return; + } my $success = C4::SMS->send_sms( { destination => $member->{'smsalertnumber'}, message => $message->{'content'}, -- 1.8.3.2