MDL-64484 user: cross-DB compatible profile field ordering.
authorPaul Holden <pholden@greenhead.ac.uk>
Wed, 12 Jun 2019 15:55:44 +0000 (16:55 +0100)
committerPaul Holden <pholden@greenhead.ac.uk>
Wed, 12 Jun 2019 15:55:44 +0000 (16:55 +0100)
user/filters/profilefield.php

index 2ae5f54..65723be 100644 (file)
@@ -74,7 +74,8 @@ class user_filter_profilefield extends user_filter_type {
      */
     public function get_profile_fields() {
         global $DB;
-        if (!$fields = $DB->get_records_menu('user_info_field', null, 'name', 'id, name')) {
+        $order = $DB->sql_order_by_text('name');
+        if (!$fields = $DB->get_records_menu('user_info_field', null, $order, 'id, name')) {
             return null;
         }
         $res = array(0 => get_string('anyfield', 'filters'));