https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42386 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #102 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Tested and confirmed three issues with Claude, otherwise the code looked good to me, it is a big change so we'll be chasing these edge cases. Claude says: I like the direction here and the unit tests pass, but I found three behaviour changes compared to main that the patches don't mention. Failing QA for now. All tested in KTD (sample data), comparing main against the patch set, with restart_all after switching. A) No 'reservesallowed' rule applying now means "unlimited" instead of "no holds" The old CanItemBeReserved treated a missing rule as 0 ("undefined is 0, blank is unlimited"). Koha::Item::Availability::Hold and Koha::Patron::Availability::Hold only check reservesallowed when it is defined, so with no matching rule holds are now allowed. To recreate: 1. Delete all circulation rules (Administration > Circulation and fine rules), or make sure no 'Holds allowed (total)' rule applies to the patron's category/item type. Saving a row with a blank value doesn't work, because blank means unlimited. 2. Check out one item of a record with several items to some patron. Without this, the default on-shelf holds policy ("If any unavailable") blocks the hold anyway. 3. Try to place a hold on that record for a different patron (e.g. Bill Palmer). - main: "Cannot place hold - No holds allowed: ... cannot place a hold on any of these items." - patch: the hold is placed. Side effect: a second hold by the same patron on the same record is (correctly) blocked by the holds_per_record default of 1, but the message says "can only place a maximum of 0 hold(s) on this record". GetMaxPatronHoldsForRecord defaults a missing rule to 0, while the availability check defaults it to 1. Th mismatch already exists on main, but you couldn't see it there because the hold was blocked earlier. B) holds_per_record = 0 no longer blocks when ignore_hold_counts is set The old CanItemBeReserved returned noReservesAllowed for holds_per_record == 0 even with ignore_hold_counts. That check now lives in the patron-level count checks, which skip_patron_checks (ignore_hold_counts) skips entirely, so the item is reported as OK. This affects CanBookBeRenewed (the "can another item fill this hold" check) and the decreaseLoanHighHolds item count. To recreate: 1. Set AllowRenewalIfOtherItemsAvailable to 'Allow'. 2. Use a record with 2 available items. Patron A checks out item 1. 3. Patron B places a title-level hold on the record. 4. Only now, set 'Holds per record (count)' = 0 on the applicable rule. 5. Try to renew patron A's checkout. - main: renewal blocked (on_reserve). - patch: renewal allowed. (Confirmed by calling C4::Circulation::CanBookBeRenewed on both versions.) C) Moving a title-level hold fails when the patron is at their limit CanBookBeReserved no longer passes ignore_hold_counts down to Koha::Biblio::Availability::Hold, so Koha::Hold->move_hold counts the hold being moved against the patron's own limit. To recreate: 1. Set 'Holds allowed (total)' = 1 on the rule that applies to the patron. Use a rule, not maxreserves, and a patron whose category doesn't have its own row (in KTD the 'S' category rows are unlimited). 2. Place one title-level hold for the patron on record X. 3. On record X's holds page, use 'Move hold' > record level to record Y. - main: the hold is moved. - patch: the move fails with too_many_reserves. Other things noticed (smaller, not blocking on their own): - CanBookBeReserved with an 'itemtype' param filters items on the raw items.itype column rather than the effective item type. This could wrongly give 'no_items' when item-level_itypes is set to the bibliographic record and items.itype is empty or different. - holds_per_record in Koha::Patron::Availability::Hold counts with ->count rather than count_holds, so it isn't hold-group aware like the other counts. - can_place_holds builds its messages from hash keys, so with no_short_circuit (as on the OPAC) the order of the messages is random. - CanBookBeReserved now dies on a biblionumber that doesn't exist (main returned ''). Current callers check first, so this is low risk. - The override list is now passed into CanItemBeReserved and CanBookBeReserved, but the x-koha-override enum only allows patron-level keys, which those wrappers skip, so the extra wiring does nothing yet. It would be great to have regression tests covering A, B and C. -- You are receiving this mail because: You are watching all bug changes.