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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 17 Apr 2024 11:58:15 +0000 (13:58 +0200)
commitee235cd8d4398ef7239db41737845eabca7363db
tree6482816f272789a175980b4b20e6c2925364fb3c
parentbe518910bc7d796c1bddf64962f12e343e1311a5
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>
C4/Circulation.pm
t/db_dependent/Circulation.t