Bug 36331: Don't check reserves that an item cannot fill when checking if it can...
authorNick Clemens <nick@bywatersolutions.com>
Fri, 15 Mar 2024 13:45:58 +0000 (13:45 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 13 May 2024 19:14:50 +0000 (19:14 +0000)
commit4837e95790c818fc735382d696548fc70007e76e
tree52f106d8214bf6c50a0b0337142040c7945843ee
parent235e865ac1a1ef9822467a00db76c9ce6eb59d6a
Bug 36331: Don't check reserves that an item cannot fill when checking if it can be renewed

Before this patch we get all holds on a record and see if we can fill them with available items.
This means we check to fill holds that the item in questoion may not be able to fill, especially
in the case where no holds are allowed on the item type, this is wrong

To test:
1 - Find or create a biblio with two items of different item types
2 - Make sure one item type allows holds, and the other has:
    "Default holds policy by item type"
    Set to "No holds allowed"
3 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
4 - Check out the unholdable item to a patron
5 - Set a hold for a different patron on the next available item
6 - Confirm the checked out item can be renewed (don't renew, just view the checkouts page)
7 - Checkout the other item to a third patron
8 - Confirm the first item can still be renewed
9 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Allow"
10 - Confirm the item cannot be renewed now
11 - Apply patch, restart all
12 - Confirm the item can be renewed
13 - Set the item type to a type that allows holds
14 - Confirm the item can no longer be renewed
15 - Restore the item type
16 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
17 - Confirm the item can be renewed
18 - Check in the item from the third patron
19 - Confirm the item can still be renewed
20 - prove -v t/db_dependent/Circulation.t - test still pass

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9cc622be1fb267efe5202f24450f9c5acee77fd2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ee235cd8d4398ef7239db41737845eabca7363db)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation.t