From 1de7da7af5f5218f0a9e8e9b9a78f0b823c7a70e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 7 Oct 2021 15:28:40 -0300 Subject: [PATCH] Bug 29157: Date and Datetime attributes cannot be set NULL Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind --- Koha/Object.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index 6f55c3b486..c7ba4704f3 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -709,7 +709,8 @@ sub attributes_from_api { } elsif ( _date_or_datetime_column_type( $columns_info->{$koha_field_name}->{data_type} ) ) { try { - $value = dt_from_string($value, 'rfc3339'); + $value = dt_from_string($value, 'rfc3339') + if defined $value; } catch { Koha::Exceptions::BadParameter->throw( parameter => $key ); -- 2.20.1