From 8a9f94320cdd5dbf682354a7531c4ffec8406f6e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 2 Jun 2020 14:36:43 +0200 Subject: [PATCH] Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON" This reverts commit a79cf4150e8a08e743acc7d7147af91757d7a9b8. Signed-off-by: Martin Renvoize --- Koha/Object.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Koha/Object.pm b/Koha/Object.pm index 44214f85c5..ed7cc4bdc9 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -353,6 +353,15 @@ 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.20.1