From 69f9ec751b8c613d1acfecf1fb8e7d7eb6a1607f Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Tue, 28 Apr 2020 13:52:52 -0700 Subject: [PATCH] LP#1865533: save changes on Edit Hold in My Account When editing a hold in the OPAC, changes are not saved if the SMS field is blank. The sms_notify value is being passed as an empty string, and this non-null value violates the "sms_check" constraint on action.hold_request. Replacing the empty string with undef allows the hold update to succeed. Signed-off-by: Jeff Davis Signed-off-by: Terran McCanna Signed-off-by: Chris Sharp --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index e246bd591c..6579300132 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1224,7 +1224,7 @@ sub handle_hold_update { $val->{"pickup_lib"} = $self->cgi->param("pickup_lib"); $val->{"email_notify"} = $self->cgi->param("email_notify") ? 1 : 0; $val->{"phone_notify"} = $self->cgi->param("phone_notify"); - $val->{"sms_notify"} = $self->cgi->param("sms_notify"); + $val->{"sms_notify"} = ( $self->cgi->param("sms_notify") eq '' ) ? undef : $self->cgi->param("sms_notify"); $val->{"sms_carrier"} = int($self->cgi->param("sms_carrier")) if $val->{"sms_notify"}; for my $field (qw/expire_time thaw_date/) { -- 2.43.2