MDL-64484 user: show full profile field name in filter element.
authorPaul Holden <pholden@greenhead.ac.uk>
Wed, 3 Apr 2019 10:40:18 +0000 (11:40 +0100)
committerPaul Holden <pholden@greenhead.ac.uk>
Fri, 7 Jun 2019 13:04:32 +0000 (14:04 +0100)
user/filters/profilefield.php

index 85ef374..2ae5f54 100644 (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;
     }
 
     /**