[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
Mon Sep 27 10:21:17 CEST 2021


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

--- Comment #15 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
I think we are perhaps trying to solve two problems here when we should be
doing different things in different situations.

I don't think we should implicitly call get_from_storage/discard_changes inside
the unblessed method as it has knock-on effects for the object.  For cases
where we want the stored object back, including any DB level trigger updates, I
think we should call that specifically as suggested by Tomas. So where we're
giving API responses, or just prior to calling logaction in many cases.

I do however, think wherever possible 'unblessed' should indeed return a
stringified value and not an object.

I think Peters solution is nearly there.. but instead of handling datetimes
specifically and throwing errors otherwise, I'd just stringify all values and
thus catch whatever we can.

Thus, my proposal would be

for my $k (keys %res) {
  $res{$k} = "$res{$k}";
}

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


More information about the Koha-bugs mailing list