From 932ad64f3503d43f696d0b3e534aaf3a48082b5a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Nov 2013 14:54:36 +0100 Subject: [PATCH] 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. Signed-off-by: Galen Charlton (cherry picked from commit 87564a834b885188ee0e6fde800775b403d2e1c0) Signed-off-by: Fridolin Somers --- C4/Letters.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 712514896e..c78d01e3d4 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'}, -- 2.39.5