MDL-31776 - lib: Alternate name fields - update of gradebook sql query.
authorAdrian Greeve <adrian@moodle.com>
Wed, 10 Jul 2013 09:41:06 +0000 (17:41 +0800)
committerAdrian Greeve <adrian@moodle.com>
Wed, 10 Jul 2013 09:41:06 +0000 (17:41 +0800)
grade/report/grader/lib.php

index 3c21585..5551f92 100644 (file)
@@ -262,7 +262,8 @@ class grade_report_grader extends grade_report {
                             }
                         }
                         if ($errorstr) {
-                            $user = $DB->get_record('user', array('id' => $userid), 'id, firstname, lastname');
+                            $userfields = 'id, ' . get_all_user_name_fields(true);
+                            $user = $DB->get_record('user', array('id' => $userid), $userfields);
                             $gradestr = new stdClass();
                             $gradestr->username = fullname($user);
                             $gradestr->itemname = $gradeitem->get_name();