Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON"

This reverts commit a79cf4150e.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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-02 14:36:43 +02:00
parent 0569072fc1
commit 59ae6ced7f
1 changed files with 9 additions and 0 deletions

View File

@ -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};