https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20886

            Bug ID: 20886
           Summary: Koha::Object::TO_JSON indiscriminately casting to
                    integer
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]

As noted in bug 20797 there appears to be a bug in Koha::Object::TO_JSON.
Specifically:

elsif ( _numeric_column_type( $columns_info->{$col}->{data_type} ) ) {

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

Here we are explicitly casting to an integer to workaround an upstream bug.
This works fine unless the data in question comes from a numeric type column
but is NULL, in which case it is cast to 0.

I suspect the desired behaviour here is for it to remain unaltered unless the
value is also numeric.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to