Browse Source

Bug 23463: (follow-up) Fix timestamp default value

For discussion, this patch revert the changes made previously.

This line exists in Koha::Item->store as it is the translation of:
    if (exists $item->{'timestamp'}) {
        delete $item->{'timestamp'};
    }
that was coming from _do_column_fixes_for_mod (called from ModItem)

To preserve existing behavior I would be in favor of keeping it like that to
avoid regression, and deal with it separately if we want to improve/remove it.

So basically here we are setting it to undef in Koha::Item->store to make it
handle correctly by the parent Koha::Object->store. I agree that's kind of weird
and must be improved.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Jonathan Druart 4 years ago
committed by Martin Renvoize
parent
commit
57eb6e4226
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 4
      Koha/Item.pm
  2. 6
      Koha/Object.pm

4
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" );

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

Loading…
Cancel
Save