[Koha-bugs] [Bug 18291] Remove SQL from preferences.pl administrative script
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Apr 24 18:04:47 CEST 2017
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18291
Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jonathan.druart at bugs.koha-c
| |ommunity.org
Status|Signed Off |Failed QA
--- Comment #6 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Alex,
There are several things wrong in these patches:
1. The test you added to t/db_dependent/sysprefs.t does not test the new method
you added to Koha::Config::SysPref
2. For modules based on Koha::Object[s], we have 2 modules:
Koha::Config::Syspref and Koha::Config::Sysprefs (notice the s at the end).
One if for a single record, the other one is for collection/list.
Modules based on Koha::Object[s] already provide you a lot of CRUD
functionalities, without doing anything in the module.
For instance Koha::Config::Sysprefs->find( $variable ) will return an object
representing the system preference $variable.
It is exactly what you are doing with your new method.
3. To access sysprefs you need to call C4::Context->preference.
This subroutine uses a cache and is the one to call to access sysprefs.
I do not see a valid reason not to fetch the in cache values here, so a 1 line
patch should do the trick ;)
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list