Bug 32129: Use patron category when checking if item can fill recall
authorAleisha Amohia <aleishaamohia@hotmail.com>
Tue, 8 Nov 2022 19:58:22 +0000 (19:58 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 15 Jun 2023 19:35:49 +0000 (19:35 +0000)
commit16ee64902341c636abf86c49481c552398352bc6
tree9780f028518f6c329fb1d007dcb9fbe492cb8793
parent1fc192eeca47f12711ef312949447aa019f45123
Bug 32129: Use patron category when checking if item can fill recall

This patch uses the patron category of the patron who requested the most
relevant recall to check for more specific circulation rules relating to
recalls. This ensures that patrons who are allowed to place recalls are
able to fill their recalls, especially when recalls are not generally
available for all patron categories.

To test:
1) Go to Administration -> System preferences and enable UseRecalls
2) Go to Administration -> Circulation and fines rules and set a general
All/All rule and a Category A/Itemtype A rule. All values can be set
however you like except for these recalls rules:

All/All rule:
Recalls allowed: 0
Recalls per record: 0
On shelf recalls allowed: if any unavailable

Category A/Itemtype A rule:
Recalls allowed: 5
Recalls per record: 5
On shelf recalls allowed: if any unavailable

3) Find an item of Itemtype A. Check it out to Patron A (any category).
4) Log into the OPAC as Patron B (of Category A). Find the item and
place a recall on the item.
5) Back in the staff interface, check in the item. This should trigger
the recalls process so you can allocate the item to Patron B's recall,
however the pop-up box to confirm the recall does not show. This is the
bug.

6) Apply the patch and restart services

7) Check in the item again. Confirm the pop-up box to confirm the recall
shows and you are able to allocate the item to Patron B's recall.
8) Confirm tests pass t/db_dependent/Koha/Item.t

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6cf8c901f55efa586a3c8b01cbbe4780c0fb028b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit a104de7094271e1d107754432a37fdc7a12cfca3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/Item.pm
t/db_dependent/Koha/Item.t