From cc618057cf455abbd4c119d1550b0e1101c87934 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 2 Jul 2015 11:20:32 +0200 Subject: [PATCH] Fix group name list. --- main/user/user.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main/user/user.php b/main/user/user.php index 024647548d..5d468f8b8a 100755 --- a/main/user/user.php +++ b/main/user/user.php @@ -613,6 +613,11 @@ function get_user_data($from, $number_of_items, $column, $direction) ) { $groupsNameList = GroupManager::getAllGroupPerUserSubscription($user_id); + $groupsNameListParsed = []; + if (!empty($groupsNameList)) { + $groupsNameListParsed = array_column($groupsNameList, 'name'); + } + $temp = array(); if (api_is_allowed_to_edit(null, true)) { @@ -634,10 +639,6 @@ function get_user_data($from, $number_of_items, $column, $direction) $temp[] = $o_course_user['username']; // Groups. - $groupsNameListParsed = []; - if (!empty($groupsNameList)) { - $groupsNameListParsed = array_column($groupsNameList, 'name'); - } $temp[] = implode(', ', $groupsNameListParsed); // Status @@ -689,7 +690,7 @@ function get_user_data($from, $number_of_items, $column, $direction) } $temp[] = $o_course_user['username']; // Group. - $temp[] = implode(', ', $groupsNameList); + $temp[] = implode(', ', $groupsNameListParsed); if ($course_info['unsubscribe'] == 1) { //User id for actions