From ba72de2339e226a9f5148a24bcdeb47de3264e33 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 13 Apr 2026 16:27:52 +0200 Subject: [PATCH] Bug 42349: Fix filtering items by recalls On the holdings table the filter by status=recalls is not working correctly. Test plan: Add a recall on an item of a bibliographic record that has several items. Filter the items table by status=recall => Without this patch all items are displayed => With this patch applied only the item with a recall is displayed Signed-off-by: David Nind Signed-off-by: Aleisha Amohia Signed-off-by: Lucas Gass (cherry picked from commit b38236830e7d374687c908949a8dd6665c48036a) Signed-off-by: Baptiste Wojtkowski --- Koha/Items.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 5e2f405a48..adbdd6fc20 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -312,9 +312,9 @@ sub filter_by_has_recalls { $params //= {}; my $recalls = Koha::Recalls->search( - { %$params, 'me.itemnumber' => [ $self->get_column('itemnumber') ], 'me.item_level' => 1, }, + { %$params, 'me.item_id' => [ $self->get_column('itemnumber') ], 'me.item_level' => 1, }, { - columns => ['itemnumber'], + columns => ['item_id'], distinct => 1 } )->_resultset->as_query;