diff --git a/Koha/Item.pm b/Koha/Item.pm index e0e1505d3a..65b55558b1 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -148,9 +148,7 @@ sub store { $self->permanent_location( $self->location ); } - if ( $self->timestamp ) { - $self->timestamp(dt_from_string); # Maybe move this to Koha::Object->store? - } + $self->timestamp(undef) if $self->timestamp; # Maybe move this to Koha::Object->store? C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ); diff --git a/Koha/Object.pm b/Koha/Object.pm index 11074498ba..fcb1e802ff 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -151,6 +151,12 @@ sub store { $self->_result()->set_column($col => $columns_info->{$col}->{default_value}); } } + elsif ( not defined $self->$col + && $columns_info->{$col}->{datetime_undef_if_invalid} ) + { + # timestamp + $self->$col( $columns_info->{$col}->{default_value} ); + } } }