Bugzilla – Attachment 186351 Details for
Bug 33364
Stop Holds to Pull report showing items that have been allocated to a recall
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33364: Prevent Holds to Pull from including items with pending recalls
Bug-33364-Prevent-Holds-to-Pull-from-including-ite.patch (text/plain), 3.81 KB, created by
Aleisha Amohia
on 2025-09-11 01:50:19 UTC
(
hide
)
Description:
Bug 33364: Prevent Holds to Pull from including items with pending recalls
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2025-09-11 01:50:19 UTC
Size:
3.81 KB
patch
obsolete
>From 5dd4d7046fc00bab0ea20add71ccd09e7ee54a0a Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Thu, 11 Sep 2025 01:48:26 +0000 >Subject: [PATCH] Bug 33364: Prevent Holds to Pull from including items with > pending recalls > >This patch checks for waiting or in_transit items allocated to recalls, and excludes them from the Holds to Pull report. > >To test: > >1. Enable UseRecalls and set the recalls-related circulation rules >2. Check out an item to Patron A >3. Place a hold on the item for Patron B >4. Log into the OPAC as Patron C and search for the item. Place a > recall on the item. >5. Go back to the staff interface. Go to Circulation -> Holds to pull >6. Confirm the item shows in the Holds to pull table, with the hold for Patron B >7. Check in the item and confirm the recall as waiting >8. Go back to the Holds to pull page. You may need to manually > regenerate the page by running the cronjob in the terminal > misc/cronjobs/holds/build_holds_queue.pl >9. Notice that even though the item is allocated for a recall, the hold > is showing. It should not be showing in this page. > >10. Apply the patch and refresh the page > >11. The item allocated to a recall should no longer be showing in the > Holds to pull report > >12. Go to the record detail page and go to the Recalls tab >13. Revert the recall from its waiting status >14. The record will now show on the Holds to pull page >15. Go to the Circulation -> Check in page >16. Go to the menu in the top-right of the page and click Set library >17. Change your library to a different one >18. Check in the item to confirm the recall as waiting and trigger a > transfer >19. Go back to the Holds to pull page, regenerate if needed >20. The item should no longer show on the Holds to pull report > >21. Confirm tests pass t/db_dependent/Koha/Holds.t > >Sponsored-by: Catalyst IT >--- > Koha/Holds.pm | 9 ++++++++- > t/db_dependent/Koha/Holds.t | 12 +++++++++++- > 2 files changed, 19 insertions(+), 2 deletions(-) > >diff --git a/Koha/Holds.pm b/Koha/Holds.pm >index 04092824ac4..e645e0ecf2a 100644 >--- a/Koha/Holds.pm >+++ b/Koha/Holds.pm >@@ -161,11 +161,18 @@ sub get_items_that_can_fill { > collapse => 1, > } > )->get_column('itemnumber'); >+ my @pending_recalls = Koha::Recalls->search( >+ { 'status' => [ 'waiting', 'in_transit' ] }, >+ { >+ columns => ['item_id'], >+ collapse => 1, >+ } >+ )->get_column('item_id'); > > return Koha::Items->search( > { > -or => \@bibs_or_items, >- itemnumber => { -not_in => [ @branchtransfers, @waiting_holds ] }, >+ itemnumber => { -not_in => [ @branchtransfers, @waiting_holds, @pending_recalls ] }, > onloan => undef, > notforloan => 0, > } >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index 1746d100b83..8a37452fbd7 100755 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -807,7 +807,7 @@ subtest 'Desks' => sub { > }; > > subtest 'get_items_that_can_fill' => sub { >- plan tests => 6; >+ plan tests => 7; > > Koha::CirculationRules->search( > { >@@ -912,6 +912,16 @@ subtest 'get_items_that_can_fill' => sub { > [ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 2 and 5 are available for filling the hold' > ); > >+ my $waiting_recall = $builder->build_object( >+ { class => 'Koha::Recalls', value => { item_id => $item_5->itemnumber, status => 'waiting' } } ); >+ $items = $holds->get_items_that_can_fill; >+ is_deeply( >+ [ map { $_->itemnumber } $items->as_list ], >+ [ $item_2->itemnumber ], >+ 'Only item 2 is available for filling the hold as item 5 is allocated to a pending recall' >+ ); >+ $waiting_recall->delete; >+ > # Marking item_5 is no hold allowed > Koha::CirculationRule->new( > { >-- >2.39.5
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 33364
:
149741
|
149742
|
149784
|
155767
|
172054
|
175080
| 186351