Bug 29531

Summary: CanBookBeRenewed is inconsistent when checking AllowRenewalIfOtherItemsAvailable
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29483
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36331
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2021-11-19 16:28:19 UTC
In working on bug 29483 it was found that the logic of CanBookBeRenewed can be flawed when relating to AllowRenewalIfOtherItemsAvailable

At checkin we call 'CheckReserves' to find holds on the current item and will fill only holds that obey hold 'policies' - but we will also fill a hold that violates the 'rules'

To recreate:
1 - Set circ rules to allow 5 holds for All/All
2 - Set an itemtype level circ rule to allow 0 holds
3 - Place a title level hold on a record with an item of that type and one of another type
4 - Note while placing hold that you cannot select the item of that type
5 - Check in the item with that type - the hold is trapped - ignore it for now
6 - Check out the other item to a patron
7 - Note the renew column in checkouts says 'On hold'
8 - Set AllowRenewalIfOtherItemsAvailable to 'Allow'
9 - Note the renew column still says 'On hold' despite the fact that that item will fill the existing hold