Bug 24254: Read the OpacHiddenItems preference internally
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 19 Dec 2020 13:21:18 +0000 (10:21 -0300)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Mon, 1 Feb 2021 20:15:36 +0000 (21:15 +0100)
commitf2872b7fa81f4ff78cde641918b0a63ef635984f
treed13b3d72222c2b6bd7508c083c930e7dbc9702a0
parentdad15b74f63efb15e337a5a2db14a4d647cc6389
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: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 2369428d7049f9847ed4ac578684a81fe03df4d0)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Koha/Items.pm
t/db_dependent/Koha/Items.t