Bug 28529: Make biblio-level hold itemtype count against max rules
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 1 Sep 2021 21:00:59 +0000 (18:00 -0300)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Thu, 21 Jul 2022 14:35:44 +0000 (16:35 +0200)
commitb115b9402dd01feb393019790992f3ef2196d17b
tree7500920027818c55601c7824608beac3042cffe2
parentc5b9e780570c450e53d6aad825b58f0caa76dda2
Bug 28529: Make biblio-level hold itemtype count against max rules

The current situation is that biblio-level holds can be assigned an item
type, so they can only be fulfilled by items matching that specified
item type (be it item-level itype or the fallback to biblio-level).

But there's the situation in which max holds limits for a specific item
type can be overridden by using biblio-level holds with item type
selection (AllowHoldItemTypeSelection) enabled.

To test:
1. Have a patron of category 'Staff' (S)
2. Have 3 records with items with the 'BK' item type, and maybe others
3. Enable AllowHoldItemTypeSelection
4. Set a limit of 2 max holds for that category+item type
5. In the OPAC. Place bibio-level holds, with item type contraint to 'BK' on those 3 records
=> FAIL: You can place the 3 holds
6. Cancel the holds
7. Apply this patch and restart all
8. Repeat 5
=> SUCCESS: You can only place 2 holds
9. Run:
   $ kshell t/db_dependent/Reserves.t
=> SUCCESS: Tests pass!
10. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Reserves.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
opac/opac-reserve.pl