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)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 10 Jun 2022 15:22:56 +0000 (15:22 +0000)
commit1f55d38918c23c7e268b2bca4c0edb5042dc3eea
treec5c835beb3a519cab9cb8ac7d55541ab9172e297
parent88bea9b8752e06ced2b535ece24b846fa1905f80
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 81bdce5c4390e1914ff6cfb2adb469027904f659)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Reserves.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
opac/opac-reserve.pl