From debf2e7a4017bf804e70479f747c2d803c1dbb73 Mon Sep 17 00:00:00 2001
From: "alejandro.campos@artica.es" <alejandro.campos@artica.es>
Date: Wed, 21 Sep 2022 13:32:36 +0200
Subject: [PATCH] fixed limitation of group_concat

---
 pandora_console/include/functions_events.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index c04308a717..a14d3cefa9 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -1467,7 +1467,6 @@ function events_get_all(
     // Secondary groups.
     $event_lj = '';
     if (!$user_is_admin || ($user_is_admin && isset($groups) === true && $groups > 0)) {
-        db_process_sql('SET group_concat_max_len = 9999999');
         if ((bool) $filter['search_secondary_groups'] === true) {
             $event_lj = events_get_secondary_groups_left_join($table);
         }
@@ -1481,6 +1480,8 @@ function events_get_all(
                 unset($fields[$idx]);
             }
 
+            db_process_sql('SET group_concat_max_len = 9999999');
+
             $group_selects = sprintf(
                 ',COUNT(id_evento) AS event_rep,
                 %s