Bug 15448: Filter out items hidden in OPAC on placing hold
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 4 Dec 2020 11:21:36 +0000 (08:21 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 14 Jan 2021 13:03:49 +0000 (14:03 +0100)
commit051f5519861cb2365ddd06d08a9047648af2318b
treef26fef5ee8bb6d2c096146086ef51ff86a47e4b4
parente26e9266d341dec77ae4c8ca17c08e9d78fc777b
Bug 15448: Filter out items hidden in OPAC on placing hold

This patch leverages on bug 24254's
Koha::Items->filter_by_visible_in_opac to filter out items that
shouldn't be presented to the end user in the OPAC interface.

To test:
1. Circulation and Fine rules for item-level holds are set to allow.
2. Setting the OpacHiddenItems preference to "ccode: [SUPPRESS]"
3. An item with collection Code Suppress is set.
4. Search for the title in the OPAC.
=> SUCCESS: The Suppress ccode item isn't shown.
5. View the detail page for the title.
=> SUCCESS: The suppress ccode item isn't shown.
6. Place a hold on the item:
  -- Click "Show more options"
  -- Select "A specific item"
=> FAIL: the ccode with the opachiddenitems rule has an item that appear in the list to place a hold
7. Apply this patch and repeat 6
=> SUCCESS: The item doesn't show!
8. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
opac/opac-reserve.pl