Bug 15766: Fix incorrect GROUP BY
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 24 Oct 2018 14:51:12 +0000 (11:51 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 24 Oct 2018 17:15:36 +0000 (17:15 +0000)
'koha_kohadev.creator_batches.description' isn't in GROUP BY

Fix t/db_dependent/Creators/Lib.t if strict sql modes is on

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Creators/Lib.pm

index 68e6aa5..c16a2c8 100644 (file)
@@ -295,7 +295,7 @@ sub get_batch_summary {
     my @batches = ();
     $params->{fields} = ['batch_id', 'description', 'count(batch_id) as _item_count'];
     my ( $query, @where_args ) = _build_query( $params, 'creator_batches' );
-    $query .= " GROUP BY batch_id";
+    $query .= " GROUP BY batch_id, description";
     my $sth = C4::Context->dbh->prepare($query);
     $sth->execute( @where_args );
     if ($sth->err) {