From 0460e2351fe797578fb1d438d3e33e65071cfd2b Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Wed, 6 Nov 2013 12:33:59 +0100
Subject: [PATCH] Bug 11207: No way to remove a sms alert number

Test plan:
1/ edit a patron
2/ set a sms alert number
3/ save
4/ edit the patron
5/ set the sms alert number to a blank value
6/ save
7/ the sms number is now an empty string
---
 members/memberentry.pl |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/members/memberentry.pl b/members/memberentry.pl
index 4b410a7..1a4061f 100755
--- a/members/memberentry.pl
+++ b/members/memberentry.pl
@@ -344,7 +344,13 @@ if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq 'duplicate')
     }
 }
 
-if ( ( defined $input->param('SMSnumber') ) && ( $input->param('SMSnumber') ne $newdata{'mobile'} ) ) {
+if (
+        defined $input->param('SMSnumber')
+    &&  (
+           $input->param('SMSnumber') eq ""
+        or $input->param('SMSnumber') ne $newdata{'mobile'}
+        )
+) {
     $newdata{smsalertnumber} = $input->param('SMSnumber');
 }
 
-- 
1.7.10.4