From b15f25d8c672d198cd074fd16f01e1f67fef955e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Nov 2013 12:33:59 +0100 Subject: [PATCH] Bug 11207: fix issue where SMS number couldn't be cleared when editing patron 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 Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Passes all tests and QA script. Test plan used: - Activate the SMS functionality by giving a 'fake' SMSSendDriver of TEST - Activate EnhancedMessagingPreferences - Create a new patron, set Other phone to 'test' - Notice that Other phone was copied to sms number - Edit messaging preference section using the edit link below on the details tab and delete SMS number - Verify it's not possible to unset the SMS number - Apply patch - Repeat deleting - this time it works Signed-off-by: Galen Charlton --- members/memberentry.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index e7f07a9265..0d3a3c3792 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -348,7 +348,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'); } -- 2.39.5