@@ -66,7 +66,7 @@ public function get_title(): string {
66
66
*/
67
67
public function get_fields (): array {
68
68
global $ DB , $ CFG ;
69
-
69
+ $ groupconcat = $ DB -> sql_group_concat ( ' g200.id ' , ' , ' );
70
70
$ fields = [
71
71
new field ('id ' , new lang_string ('user ' ), $ this , null , [
72
72
new identifier_attribute (),
@@ -128,17 +128,15 @@ public function get_fields(): array {
128
128
]),
129
129
]),
130
130
new field ('group_names ' , new lang_string ('group ' ), $ this , [
131
- 'select ' => "(SELECT group_concat(g200.id, ',') FROM {groups} g200
131
+ 'select ' => "(SELECT $ groupconcat FROM {groups} g200
132
132
JOIN {groups_members} gm200 ON gm200.groupid = g200.id WHERE gm200.userid = u.id) " ,
133
- 'select_pgsql ' => "(SELECT string_agg(g200.id::text, ',') FROM {groups} g200
134
- JOIN {groups_members} gm200 ON gm200.groupid = g200.id AND gm200.userid = u.id) " ,
135
133
], [
136
134
new rename_group_ids_attribute ([
137
135
'table ' => 'groups ' ,
138
136
'field ' => 'name ' ,
139
137
'delimiter ' => ', ' , // Separator between each ID in SQL select.
140
138
]),
141
- ]),
139
+ ], [], field_interface:: VISIBILITY_VISIBLE , '' ),
142
140
];
143
141
144
142
require_once ("$ CFG ->dirroot /user/profile/lib.php " );
@@ -148,7 +146,8 @@ public function get_fields(): array {
148
146
$ fields [] = new field ('pf_ ' . strtolower ($ customfield ->shortname ),
149
147
new lang_string ('customfield ' , 'block_dash ' , ['name ' => format_string ($ customfield ->name )]),
150
148
$ this , "(SELECT profile $ i.data FROM {user_info_data} profile $ i
151
- WHERE profile $ i.userid = u.id AND profile $ i.fieldid = $ customfield ->id ) "
149
+ WHERE profile $ i.userid = u.id AND profile $ i.fieldid = $ customfield ->id ) " ,
150
+ [], [],field_interface::VISIBILITY_VISIBLE , '' ,
152
151
);
153
152
154
153
$ i ++;
0 commit comments