Merge branch 'MDL-64484-36' of https://github.com/paulholden/moodle into MOODLE_36_STABLE

This commit is contained in:
Andrew Nicols
2019-06-12 09:01:59 +08:00
+3 -5
View File
@@ -74,14 +74,12 @@ class user_filter_profilefield extends user_filter_type {
*/
public function get_profile_fields() {
global $DB;
if (!$fields = $DB->get_records('user_info_field', null, 'shortname', 'id,shortname')) {
if (!$fields = $DB->get_records_menu('user_info_field', null, 'name', 'id, name')) {
return null;
}
$res = array(0 => get_string('anyfield', 'filters'));
foreach ($fields as $k => $v) {
$res[$k] = $v->shortname;
}
return $res;
return $res + $fields;
}
/**