From b4610ef8b953ec2bc6df11cc8fe14a1270308865 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Jul 2020 08:58:04 +0200 Subject: [PATCH] Bug 24488: Fix reserve.reserve_id' isn't in GROUP BY Signed-off-by: Michal Denar Signed-off-by: Josef Moravec --- circ/pendingreserves.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 3f35ddb96f..2500160dd7 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -20,6 +20,7 @@ use Modern::Perl; use constant PULL_INTERVAL => 2; +use List::MoreUtils qw( uniq ); use C4::Context; use C4::Output; @@ -183,16 +184,15 @@ if ( C4::Context->preference('IndependentBranches') ){ } # get all distinct unfulfilled reserves -my @distinct_holds = Koha::Holds->search( +my $distinct_holds = Koha::Holds->search( { %where }, - { join => 'itembib', group_by => 'reserve.biblionumber', alias => 'reserve' } + { join => 'itembib', alias => 'reserve' } ); +my @biblionumbers = uniq $distinct_holds->get_column('biblionumber'); # make final reserves hash and fill with info my $reserves; -foreach my $dh ( @distinct_holds ){ - - my $bibnum = $dh->biblionumber; +foreach my $bibnum ( @biblionumbers ){ my @items = Koha::Items->search({ biblionumber => $bibnum }); foreach my $i ( @items ){ -- 2.11.0