Bugzilla – Attachment 192915 Details for
Bug 41552
Holds are not removed from holds queue when hold is suspended
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41552: Remove hold from holds queue when suspended
5f17783.patch (text/plain), 1.57 KB, created by
Kyle M Hall (khall)
on 2026-02-10 16:53:24 UTC
(
hide
)
Description:
Bug 41552: Remove hold from holds queue when suspended
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2026-02-10 16:53:24 UTC
Size:
1.57 KB
patch
obsolete
>From 5f17783d55bdd307470c84bc38efffa66354fc04 Mon Sep 17 00:00:00 2001 >From: John Doe <you@example.com> >Date: Tue, 10 Feb 2026 16:47:40 +0000 >Subject: [PATCH] Bug 41552: Remove hold from holds queue when suspended > >If one is not using the real time holds queue, holds are not removed from the queue when suspended. Instead, they remain listed until the next time the cron is run. We should remove holds from the queue immediately when suspended, as we do when a hold is filled. > >Test Plan: >1) Apply this patch >2) prove t/db_dependent/HoldsQueue.t >--- > Koha/Hold.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index d030282997b..68fef475f0a 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -126,6 +126,22 @@ sub suspend_hold { > Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [ $self->biblionumber ] } ) > if C4::Context->preference('RealTimeHoldsQueue'); > >+ # Remove from holds queue if present >+ my $dbh = $self->_result->result_source->schema->storage->dbh; >+ $dbh->do( >+ q{ >+ DELETE q, t >+ FROM tmp_holdsqueue q >+ INNER JOIN hold_fill_targets t >+ ON q.borrowernumber = t.borrowernumber >+ AND q.biblionumber = t.biblionumber >+ AND q.itemnumber = t.itemnumber >+ AND q.item_level_request = t.item_level_request >+ AND q.holdingbranch = t.source_branchcode >+ WHERE t.reserve_id = ? >+ }, undef, $self->id >+ ); >+ > return $self; > } > >-- >2.50.1 (Apple Git-155) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41552
:
192914
|
192915
|
192916
|
192917