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 <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 7535b50723)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Aleisha Amohia 2020-02-09 21:55:01 +00:00 committed by Lucas Gass
parent 8eb9292a15
commit 1fced79e40
1 changed files with 4 additions and 7 deletions

View File

@ -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);
}