https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41809 --- Comment #6 from Andrii Nugged <nugged@gmail.com> --- Created attachment 204738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204738&action=edit Bug 41809: Preserve waiting hold on other-item checkout When a patron checks out another item from a record with a waiting title-level hold, MoveReserve fills the hold using the checked-out item. This moves the hold to history and detaches the pickup-shelf item, leaving staff without an action to remove it. For a waiting hold, add a cancellation request instead. The hold remains linked to the pickup-shelf item and therefore remains unavailable until staff processes the request. Keep the existing fill behavior for non-waiting title-level holds. Delete cancellation requests in both terminal paths, cancel and fill, before moving the active hold to history. Both cleanups run inside the existing transactions. This covers staff and batch cancellation and the case where a patron later checks out the pickup-shelf item itself. Requests belonging to other holds remain untouched, and a failed fill rolls its cleanup back. The previous waiting-hold assertion was ineffective because it created an item-level hold on another item. Replace it with a captured title-level hold and exercise the real AddIssue path. The regression coverage also verifies availability, HoldsQueue eligibility, sequential idempotence, terminal cleanup, cleanup isolation and rollback, the non-waiting behavior, the disabled rule, item-level and other-patron holds, and multiple-request cleanup. Test plan: Before applying the patch: 1. In Administration > Circulation and fine rules, set "Fill other holds on record" to "Yes" for an item type. 2. Create a record with two available items of that item type. 3. Place a record-level hold for a patron. 4. Open Circulation > Check in, check in item A, and confirm the hold so it becomes Waiting. 5. Open the checkout page for the same patron and check out item B. 6. Confirm the checkout succeeds and names item B. 7. Confirm the waiting hold on item A is no longer shown for the patron. 8. Open Circulation > Holds awaiting pickup. 9. Confirm item A is not under "Holds with cancellation requests". Apply the patch. After applying the patch: 1. Create a fresh record with two available items of the same item type. 2. Place a record-level hold for a patron. 3. Open Circulation > Check in, check in item A, and confirm the hold so it becomes Waiting. 4. Open the checkout page for the same patron and check out item B. 5. Confirm the checkout succeeds and names item B. 6. Confirm the hold remains Waiting and linked to item A. 7. Open Circulation > Holds awaiting pickup. 8. Confirm item A appears once under "Holds with cancellation requests". 9. Confirm item A is not shown as available. 10. Cancel the hold from the report or check in item A. 11. Confirm the request disappears and the hold is Cancelled in history. 12. Repeat steps 1-9 with fresh data, then check out item A to the patron. 13. Confirm the hold is Filled by item A and its request disappears. 14. Place a non-waiting record-level hold, check out another item from that record to the patron, and confirm the hold is filled as before. Automated tests: 1. prove t/db_dependent/Reserves.t 2. prove t/db_dependent/Koha/Hold.t 3. prove t/db_dependent/Koha/Holds.t 4. prove t/db_dependent/SIP/Transaction.t 5. prove t/db_dependent/HoldsQueue.t Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.