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 <jdavis@sitka.bclibraries.ca>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
$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/) {