Bugzilla – Attachment 161790 Details for
Bug 35357
Item not removed from holds queue when checked out to a different patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35357: Remove item from holds queue when it is checked out
Bug-35357-Remove-item-from-holds-queue-when-it-is-.patch (text/plain), 2.81 KB, created by
Kyle M Hall (khall)
on 2024-02-06 17:12:40 UTC
(
hide
)
Description:
Bug 35357: Remove item from holds queue when it is checked out
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-02-06 17:12:40 UTC
Size:
2.81 KB
patch
obsolete
>From 9ce172ef874de4602d5555a1ead75289b6713545 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >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! > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Circulation.pm | 6 ++++++ > t/db_dependent/HoldsQueue.t | 13 +++++++++---- > 2 files changed, 15 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 109809d4b99..6bdd4a2a8f1 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'); >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 6bb0d8f0c18..8fb0b94c4c2 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -2114,8 +2114,7 @@ subtest 'Remove item from holds queue on checkout' => sub { > } > ); > >- my $item = $builder->build_sample_item( >- { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode } ); >+ my $item = $builder->build_sample_item( { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode } ); > > t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } ); > >@@ -2131,11 +2130,17 @@ subtest 'Remove item from holds queue on checkout' => sub { > > C4::HoldsQueue::CreateQueue(); > >- is( Koha::Hold::HoldsQueueItems->search({ itemnumber => $item->id })->count(), 1, "Item is found in the holds queue" ); >+ is( >+ Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 1, >+ "Item is found in the holds queue" >+ ); > > AddIssue( $patron1, $item->barcode, dt_from_string ); > >- is( Koha::Hold::HoldsQueueItems->search({ itemnumber => $item->id })->count(), 0, "Item is no longer found in the holds queue" ); >+ is( >+ Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 0, >+ "Item is no longer found in the holds queue" >+ ); > > $schema->storage->txn_rollback; > }; >-- >2.30.2
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 35357
:
160851
|
160852
|
161009
|
161010
|
161789
|
161790
|
161791
|
161792
|
161849
|
161850
|
161851