]> git.koha-community.org Git - koha.git/commit
Bug 24254: Read the OpacHiddenItems preference internally
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 19 Dec 2020 13:21:18 +0000 (10:21 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 19 Jan 2021 07:44:34 +0000 (08:44 +0100)
commitf09f34864331f0b3ad0e5c23cd93e6dbb1e35087
tree7a2196f0a4d4c11501ea6795d5dce45f6facddec
parentaacc3b7c3666e20c7d25fad88854375df706638e
Bug 24254: Read the OpacHiddenItems preference internally

After discussing the 'rules' parameter usefulness we decided it was not
the best idea, and the gains in terms of 'performance' would me
meaningless (in-memory caching of sysprefs). This patch makes a really
minor tweak to the tests so they mock the C4::Context->yaml_preference
method, but keeping the same original rules to highlight no behaviour
change takes place.

Then the rules parameter is removed from the calls, and the tests should
keep passing.

A minor change to make $rules = undef is made to highlight the // {}
behaviour when reading the syspref..

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b1eda4facde26883e76ee321e142650525438846)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Items.pm
t/db_dependent/Koha/Items.t