13562-Fix duplicate column id_grupo in events_get_all()

This commit is contained in:
Pablo Aragon 2024-04-16 12:10:05 +02:00
parent aa00fe6a22
commit 4a20bdb2fd
1 changed files with 9 additions and 2 deletions

View File

@ -1675,8 +1675,15 @@ function events_get_all(
}
if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
if (str_contains($fields[0], 'te.id_grupo') === false) {
$fields[0] .= ', te.id_grupo';
$exists_id_grupo = false;
foreach ($fields as $field) {
if (str_contains($field, 'te.id_grupo') === true || str_contains($field, 'te.*') === true) {
$exists_id_grupo = true;
}
}
if ($exists_id_grupo === false) {
$fields[] = 'te.id_grupo';
}
}