Bug 39820: Cancel holds with cancellation requests via SIP

To test:
1. In circ rules set a Default waiting hold cancellation policy to allow hold cancellation requests.
2. Add a hold for a patron and create a hold cancellation request.
3. Check the item in via SIP, I used the SIP emulator:

kohadevbox/koha/misc/sip_cli_emulator.pl -a localhost -p 6001 -l MPL -su term1 -sp term1 -m checkin --patron 23529000035676 --item 39999000001310

4. The hold remains.
5. APPLY PATCH, restart_all
6. Try 2 - 4 again, the hold should be cancelled

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lucas Gass 2025-05-06 21:22:20 +00:00
parent e9481a678c
commit 2246bfbb4a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,12 @@ sub do_checkin {
my ( $return, $messages, $issue, $borrower );
my $item = Koha::Items->find( { barcode => $barcode } );
if ($item) {
my $waiting_holds_to_be_cancelled = $item->holds->waiting->filter_by_has_cancellation_requests;
while ( my $hold = $waiting_holds_to_be_cancelled->next ) {
$hold->cancel;
}
}
my $human_required = 0;
if ( C4::Context->preference("CircConfirmItemParts")