From 4c83967aa6c718f6ef3319db3ffad5719598e845 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Wed, 1 Oct 2025 23:56:06 +0000 Subject: [PATCH] Bug 38122: (follow-up) Fix grouping of holdings by status when sorting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When 'Group by status' is enabled, sorting on other columns is ignored to ensure that items remain correctly grouped by status. To test: 1. Apply the patch 2. Run yarn build 3. Create a record with multiple itemss having different statuses. 4. Click on «Group by status» button ---> items are grouped by status 5. Sort on other colunms ---> items are still grouped by status 6. Click on «Ungroup by status» button ---> items are no more grouped by status --- Koha/REST/V1/Biblios.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm index cb3052b2ea8..718d3287c65 100644 --- a/Koha/REST/V1/Biblios.pm +++ b/Koha/REST/V1/Biblios.pm @@ -265,6 +265,7 @@ sub get_items { $items_rs = $items_rs->filter_by_bookable if $bookable_only; if ($group_by_status) { + $c->req->params->remove('_order_by'); my @item_ids; for my $status ( qw( available checked_out local_use in_transit lost withdrawn damaged not_for_loan on_hold recalled in_bundle restricted ) -- 2.34.1