[Koha-bugs] [Bug 28700] "Unblessed" method in Object.pm has blessed values for keys in some cases

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 26 12:08:11 CEST 2021


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

--- Comment #29 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
I'm coming round to Tomas's thinking.. why not just use TO_JSON...

Let me justify that.. for stringification, TO_JSON already handles the majority
of cases.. we look at the column definitions to ascertain booleans, numbers,
decimals and dates and then do the right thing to 'stringify' them based on
that information.

I find the 'unblessed' method generally a bit strange if I'm honest.. it
doesn't return all internal fields in a hash (there might be other local data
fields in the objects messages structure for example)... it only deals with
database columns.. also TO_JSON doesn't actually return a JSON string.. it
returns a hashref which is then turned into a JSON string later... the one
caveat here is we have Mojo::JSON based boolean objects instead of true/false
strings which we might expect in an 'unblessed' return.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list