From 14b151c06eb762e96edce36e0cebd49c02a47b3b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Jun 2020 16:09:46 +0200 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart (cherry picked from commit f4f3c8f18b5587ad8629b77b457e9593d781dac6) Signed-off-by: Lucas Gass --- Koha/Object.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index 6a741400be..c6ae91e4ef 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -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 ) ) { -- 2.39.5