From b345bf4ea762621a7811304f4cc6c64066b7ddc0 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 20 Mar 2022 15:32:44 +0100 Subject: [PATCH] Fix metrics and notifications when sql_mode is only_full_group_by (since MySQL 5.7/8.0) --- includes/model/UserAngelTypes_model.php | 2 +- src/Controllers/Metrics/Stats.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/model/UserAngelTypes_model.php b/includes/model/UserAngelTypes_model.php index 880faf9d..0e24a1bb 100644 --- a/includes/model/UserAngelTypes_model.php +++ b/includes/model/UserAngelTypes_model.php @@ -60,7 +60,7 @@ function User_unconfirmed_AngelTypes($userId) AND `UserAngelTypes`.`supporter`=TRUE AND `AngelTypes`.`restricted`=TRUE AND `UnconfirmedMembers`.`confirm_user_id` IS NULL - GROUP BY `UserAngelTypes`.`angeltype_id`, `UserAngelTypes`.`id` + GROUP BY `UserAngelTypes`.`angeltype_id`, `UserAngelTypes`.`id`, AngelTypes.name, UserAngelTypes.user_id, UserAngelTypes.confirm_user_id, UserAngelTypes.supporter ORDER BY `AngelTypes`.`name` ', [$userId]); } diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php index 9aed2a3d..66818ec5 100644 --- a/src/Controllers/Metrics/Stats.php +++ b/src/Controllers/Metrics/Stats.php @@ -309,7 +309,7 @@ class Stats $this->workSecondsQuery($done, $freeloaded), 'UID', 'SUM(end - start)', - 'end - start' + 'SUM(end - start)' ); } @@ -364,7 +364,7 @@ class Stats Worklog::query(), 'user_id', 'SUM(hours * 60 * 60)', - 'hours * 60 * 60' + 'SUM(hours * 60 * 60)' ); }