From 62c5a5c96099d8f354b3d9d46cabe7f6b6ecd03d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 3 Jun 2022 08:26:41 +0200 Subject: [PATCH] Bug 27272: Remove GetItemsInfo from serials/routing-preview Signed-off-by: Victor Grousset/tuxayo --- serials/routing-preview.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index b33cb8dbcd..d6cadaabf9 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -25,7 +25,6 @@ use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use C4::Reserves qw( AddReserve ModReserve ); use C4::Context; -use C4::Items qw( GetItemsInfo ); use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); use URI::Escape; @@ -62,14 +61,16 @@ my $library; if($ok){ # get biblio information.... my $biblionumber = $subs->{'bibnum'}; - my @itemresults = GetItemsInfo( $biblionumber ); - my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode}; - $library = Koha::Libraries->find($branch); - if (C4::Context->preference('RoutingListAddReserves')){ # get existing reserves ..... my $biblio = Koha::Biblios->find( $biblionumber ); + my $items = $biblio->items; + my $branch = + $items->count + ? $items->next->holding_branch->branchcode + : $subs->{branchcode}; + $library = Koha::Libraries->find($branch); my $holds = $biblio->current_holds; my $count = $holds->count; while ( my $hold = $holds->next ) { -- 2.37.1