From 9ef4bad47377eefa83bc6a2fe5ae64e39707c266 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Feb 2018 14:41:48 -0300 Subject: [PATCH] Bug 20144: [sql_modes] Fix default value for statistics.amount Must be an integer, not empty string Fix for: Data truncated for column 'value' Found with t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart --- C4/Stats.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Stats.pm b/C4/Stats.pm index 2ad685cbe6..86096bffdd 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -120,7 +120,7 @@ sub UpdateStats { my $type = $params->{type}; my $borrowernumber = exists $params->{borrowernumber} ? $params->{borrowernumber} : ''; my $itemnumber = exists $params->{itemnumber} ? $params->{itemnumber} : ''; - my $amount = exists $params->{amount} ? $params->{amount} : ''; + my $amount = exists $params->{amount} ? $params->{amount} : 0; my $other = exists $params->{other} ? $params->{other} : ''; my $itemtype = exists $params->{itemtype} ? $params->{itemtype} : ''; my $location = exists $params->{location} ? $params->{location} : undef; -- 2.39.5