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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 1 Jun 2022 19:26:44 +0000 (16:26 -0300)
commit81bdce5c4390e1914ff6cfb2adb469027904f659
treea9192adec443ecdb2a5610b0413fdb0a5190aa53
parentad14a8eee8a8f229518ee0d40c7d9c807f1c0937
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>
C4/Reserves.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
opac/opac-reserve.pl