From a79cf4150e8a08e743acc7d7147af91757d7a9b8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 May 2020 14:29:20 +0200 Subject: [PATCH] Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON This patch removes a problematic integer casting happening in TO_JSON. The original need for this cast (a DBD::mysql bug) is now fixed. We remove the cast as it is causing random failures. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/api/v1/acquisitions_orders.t => FAIL: Tests fail with select high values (i.e. casting gives wrong results) 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests now pass! 5. Sign off :-D Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- Koha/Object.pm | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index ed7cc4bdc9..44214f85c5 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -353,15 +353,6 @@ sub TO_JSON { ? Mojo::JSON->true : Mojo::JSON->false; } - elsif ( _numeric_column_type( $columns_info->{$col}->{data_type} ) - and looks_like_number( $unblessed->{$col} ) - ) { - - # TODO: Remove once the solution for - # https://rt.cpan.org/Ticket/Display.html?id=119904 - # is ported to whatever distro we support by that time - $unblessed->{$col} += 0; - } elsif ( _datetime_column_type( $columns_info->{$col}->{data_type} ) ) { eval { return unless $unblessed->{$col}; -- 2.39.5