From 7535b5072329cc38ef7f0cef2616d51b289efb0b Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 9 Feb 2020 21:55:01 +0000 Subject: [PATCH] Bug 18933: Allow OPAC messaging SMS number to be set to empty To test: 1) Ensure EnhancedMessagingPreferences is enabled and EnhancedMessagingPreferencesOPAC is set to Show. Set SMSSendDriver to Email 2) Log in to OPAC, go to your messaging tab 3) Set an SMS number if you havent already 4) Try to remove it (set to empty) 5) Notice that it says the number has been updated, but it has not been set to empty 6) Apply patch and refresh page 7) Attempt to set the number to empty 8) Confirm this is successful Sponsored-by: Catalyst IT Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- opac/opac-messaging.pl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 8a6996ae18..496c2addec 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -57,13 +57,10 @@ my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { my $sms = $query->param('SMSnumber'); my $sms_provider_id = $query->param('sms_provider_id'); - if ( defined $sms && ( $patron->smsalertnumber // '' ) ne $sms - or ( $patron->sms_provider_id // '' ) ne $sms_provider_id ) { - $patron->set({ - smsalertnumber => $sms, - sms_provider_id => $sms_provider_id, - })->store; - } + $patron->set({ + smsalertnumber => $sms, + sms_provider_id => $sms_provider_id, + })->store; C4::Form::MessagingPreferences::handle_form_action($query, { borrowernumber => $patron->borrowernumber }, $template); } -- 2.39.5