From 500ff71ebdafe20b72c7792abf7f2fe5688dea3f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 11 Jan 2024 09:31:45 -0500 Subject: [PATCH] Bug 35357: Remove item from holds queue when it is checked out Test Plan: 1) Place a hold on an item 2) Build the holds queue 3) Check out the item to a different patron than the one targeted in the holds queue 4) Verify the holds queue viewer still shows that item and patron 5) Apply this patch 6) Repeat stepts 1 through 3 7) Verify the holds queue viewer no longer shows that patron and item! --- C4/Circulation.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 29abc95ac7a..3a62f0af132 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1729,6 +1729,12 @@ sub AddIssue { %$issue_attributes, } )->store; + + # Ensure item is no longer listed in the holds queue + $dbh->do( + q{DELETE tmp_holdsqueue, hold_fill_targets FROM tmp_holdsqueue LEFT JOIN hold_fill_targets USING ( itemnumber ) WHERE itemnumber = ?}, + undef, $item_object->id + ); } $issue->discard_changes; $patron->update_lastseen('check_out'); -- 2.30.2