From 0ea644ac7f358566eb7a5d22c397020f0155a5da Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 22 Mar 2023 14:04:24 +0000 Subject: [PATCH] Bug 29099: Fix item bundle fetch in inventory script Content-Type: text/plain; charset=utf-8 Using the newly created Koha objects. --- .../prog/en/modules/tools/inventory.tt | 2 +- tools/inventory.pl | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt index 813ee21873..cdff54d2ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -159,7 +159,7 @@ diff --git a/tools/inventory.pl b/tools/inventory.pl index 96b4833ad6..ffcd436808 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -42,6 +42,7 @@ use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::ClassSources; use Koha::Items; +use Koha::Item::Bundles; use List::MoreUtils qw( none ); @@ -70,18 +71,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -my $schema = Koha::Database->new()->schema(); -my $item_bundles_rs = Koha::Items->search( - { - 'item_bundles_hosts.item' => { '!=' => undef }, - }, - { - join => 'item_bundles_hosts', - group_by => 'itemnumber', - } -); - -my @item_bundles = $item_bundles_rs->as_list; +my @item_bundles = Koha::Item::Bundles->search( + {}, + { group_by => [ 'host' ], columns => [ 'host' ] }, +)->as_list; my @authorised_value_list; my $authorisedvalue_categories = ''; -- 2.30.2