https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42858 Bug ID: 42858 Summary: AddReturn does not handle Transfer->receive OnLoan exception gracefully Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Blocks: 42851 Target Milestone: --- Split off from bug 42851. Koha::Item::Transfer->receive throws Koha::Exceptions::Item::Transfer::OnLoan if the item is still checked out (Koha/Item/Transfer.pm:173). It is called unguarded inside AddReturn (C4/Circulation.pm:2560, 2573). An uncaught exception there aborts the check-in mid-way, potentially leaving the transfer unresolved and the operation in an inconsistent state. Proposed approach: catch the exception, deal with the transfer sensibly, and prompt the staff member for action rather than dying. Test plan: 1. Construct the state where an item has an open transfer and is still shown as checked out at the point receive() is called. 2. Check the item in. 3. Before: exception bubbles up, check-in aborts, transfer unresolved. 4. After: handled gracefully with a clear staff prompt; transfer state consistent. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42851 [Bug 42851] [OMNIBUS] Items left stuck in transit when checked in outside the staff returns page -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.