From 227d7b950e682300a7697ada4f6837a950f098e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Wed, 19 Aug 2015 11:42:50 +0000 Subject: [PATCH] Bug 14683: Unable to clear SMS number Enables to clear SMS number. To test: 1. Go to opac-messaging.pl 2. Insert SMS number and submit 3. Clear SMS number and submit 4. Observe that the sms number did not change 5. Apply patch 6. Clear SMS number and submit 7. Observe that the sms number changes Sponsored-by: Vaara-kirjastot Signed-off-by: Marcel de Rooy Adding a follow-up. Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 5b1c7e4c359e974e5aca801579db72b356741a0f) Signed-off-by: Chris Cormack --- opac/opac-messaging.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 3e55c5723f..0c4426bc73 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -51,8 +51,7 @@ my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { - # If they've modified the SMS number, record it. - if ( ( defined $query->param('SMSnumber') ) && ( $query->param('SMSnumber') ne $borrower->{'mobile'} ) ) { + if ( $query->param('SMSnumber') ne $borrower->{'mobile'} ) { ModMember( borrowernumber => $borrowernumber, smsalertnumber => $query->param('SMSnumber') ); $borrower = GetMemberDetails( $borrowernumber ); @@ -66,7 +65,7 @@ C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowe # warn( Data::Dumper->Dump( [ $messaging_options ], [ 'messaging_options' ] ) ); $template->param( BORROWER_INFO => [ $borrower ], messagingview => 1, - SMSnumber => defined $borrower->{'smsalertnumber'} ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'}, + SMSnumber => $borrower->{'smsalertnumber'} ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'}, SMSSendDriver => C4::Context->preference("SMSSendDriver"), TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification") ); -- 2.39.5