[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 13:57:43 CEST 2021


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

--- Comment #40 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
(In reply to Marcel de Rooy from comment #39)
> (In reply to Jonathan Druart from comment #20)
> > 
> > kidclamp> should we just address this per case? do we need a global
> > solution? i.e. we know if we touch an object variable we can introduce this
> > problem, so we should know to fetch from storage if an unblessed is need
> > kidclamp> yes, asking why we want to build it into logging rather than place
> > responsibility on the caller
> 
> I tend to agree here. What is the biggest problem items with datetimes, as
> referred to in first comment? Others?

That's the entire point of my patch... generally, the expectation of unblessed
is that it returns a hash of the object data.. thus catching when that is
likely to not be the case and throwing an error to get the developer to check
seems like the right thing to do.. 

In short: 

kidclamp> should we just address this per case?

Yes

kidclamp> if we touch an object variable we can introduce this problem, so we
should know to fetch from storage if an unblessed is need.

My patch makes that more explicit by throwing an exception when the object has
been touched.

Jonathan> I was suggesting to pass the object, yes.

That's a big change requiring all calls to logaction be looked at.. that's
kinda the same as my patch.. it also requires all calls to unblessed be looked
at and prevents future regressions in calls to unblessed.

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


More information about the Koha-bugs mailing list