Bug 22812: Fix GROUP BY in checkrouting
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 6 May 2019 18:50:54 +0000 (13:50 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 24 May 2019 13:50:23 +0000 (14:50 +0100)
On the way, let fix this error
DBD::mysql::st execute failed: Mixing of GROUP columns
(MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is
no GROUP BY clause [for Statement "SELECT count(routingid) routingids
FROM subscription LEFT JOIN subscriptionroutinglist

Test plan:
Create a routing list, search for subscriptions
In the action list you should see "Edit routing list (1)" or "New
routing list"

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 256b134a94e83b7072b5891a2d60f0e08e813583)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Serials.pm

index 7f722f4..b339dca 100644 (file)
@@ -1884,7 +1884,7 @@ sub check_routing {
     my $sth              = $dbh->prepare(
         "SELECT count(routingid) routingids FROM subscription LEFT JOIN subscriptionroutinglist 
                               ON subscription.subscriptionid = subscriptionroutinglist.subscriptionid
-                              WHERE subscription.subscriptionid = ? ORDER BY ranking ASC
+                              WHERE subscription.subscriptionid = ? GROUP BY routingid ORDER BY ranking ASC
                               "
     );
     $sth->execute($subscriptionid);