[Koha-bugs] [Bug 32478] Remove Koha::Config::SysPref->find since bypasses cache

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 4 18:00:47 CEST 2023


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

--- Comment #6 from David Gustafsson <glasklas at gmail.com> ---
(In reply to Nick Clemens from comment #4)
> (In reply to Nick Clemens from comment #3)
> > (In reply to Jonathan Druart from comment #2)
> > > I don't think the removal here is correct, the method does more than
> > > C4::Context->yaml_preference
> > > 
> > > Nick maybe?
> > 
> > perl -e 'use Koha::Config::SysPrefs; use C4::Context; my $sp =
> > Koha::Config::SysPrefs->find("ItemsDeniedRenewal")->get_yaml_pref_hash; warn
> > Data::Dumper::Dumper($sp); warn Data::Dumper::Dumper(
> > C4::Context->yaml_preference("ItemsDeniedRenewal"));'
> > 
> > It doesn't convert from 'NULL' to undef - the expectation is that we can
> > pass the return value into a DBIC search directly
> 
> Perhaps we removed the wrong copy here:
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27154
> 
> One was an object, the other took a pref name, so would have used cache

Yes, it would have used cache, but still a good thing to remove it as
C4::Context->yaml_preference exists using a proper yaml-parser (and utilized
cache). Thanks for pointing out the nuance of the special handling of NULL
values. null (lowercase) is valid yaml for null values (converted to undef by
the perl parser). So the problem can be solved by using that instead of NULL.
Provided a patch to fix this.

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


More information about the Koha-bugs mailing list