Bug 25638: Fix regression

Now that float/decimal columns are not treated similar to integer ones,
the default value handling we had set for numeric values is not trapping
the float/decimal cases as it should.

We love tests!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-06-05 16:09:46 +02:00
parent 8dfbc46aa4
commit f4f3c8f18b

View file

@ -127,7 +127,9 @@ sub store {
# Handle not null and default values for integers and dates
foreach my $col ( keys %{$columns_info} ) {
# Integers
if ( _numeric_column_type( $columns_info->{$col}->{data_type} ) ) {
if ( _numeric_column_type( $columns_info->{$col}->{data_type} )
or _decimal_column_type( $columns_info->{$col}->{data_type} )
) {
# Has been passed but not a number, usually an empty string
my $value = $self->_result()->get_column($col);
if ( defined $value and not looks_like_number( $value ) ) {