https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43727 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 207306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207306&action=edit Bug 43727: SIP no block checkouts and offline checkouts leave another patron's waiting hold in place When a SIP2 client sends a checkout with the no block flag set to Y, Koha has to accept it, so the checkout skips every check and goes through ProcessOfflineIssue. ProcessOfflineIssue calls AddIssue without a cancelreserve value, so a hold that is waiting, in transit, or in processing for a different patron is left alone. The item ends up checked out to one patron while it is still on another patron's holds waiting list. The hold sits there until it expires off the hold shelf, so the patron who placed it never gets the item. When staff check out an item with a waiting hold in the staff interface, Koha defaults to reverting the hold's waiting status. No block and offline checkouts should do the same, so the hold goes back to the top of the queue and is filled by the next copy. This patch makes ProcessOfflineIssue revert a hold found for another patron, the same as the staff interface does by default. Pending holds are still left alone, as they have been since bug 30114. Test Plan: 1) Apply the unit tests patch 2) prove t/db_dependent/Circulation/OfflineCirculation.t 3) Note the new subtest fails! 4) Apply this patch 5) Restart all the things! 6) prove t/db_dependent/Circulation/OfflineCirculation.t 7) Note the tests pass! 8) Place a hold for patron A on an item, check the item in and confirm the hold so it is waiting 9) Do a no block SIP checkout of that item to patron B: perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m checkout --patron <patron B cardnumber> -i <barcode> -n Y 10) Note the item is checked out to patron B 11) Note patron A's hold is no longer waiting, it is back in the queue at priority 1! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.