[Koha-bugs] [Bug 24254] Add Koha::Items->filter_by_visible_in_opac
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Dec 21 19:57:41 CET 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24254
--- Comment #28 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 114574
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114574&action=edit
Bug 24254: Implement separate filters and add patron param
This patch introduces two new methods for stacking filters on
Koha::Items:
- filter_out_lost
_ filter_out_opachiddenitems
This two filters are what actually happened inside the
filter_by_visible_in_opac. Everything is covered by tests.
In the process I added a Koha::Patron param to the method that is
internally used to decide if the OPACHiddenItems syspref needs to be
honoured or not. This *could* be better done with a fallback to
C4::Context->userenv if no param is passed.
I decided to leave that part for later, if we really find it would help
(e.g. if bug 10589 gets some action and we really need something here to
handle that).
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list