-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.6.3
-
MOODLE_26_STABLE
The additional names fields are not included in grade exports despite adding the fields to the grade_export_userprofilefields admin setting.
I tracked this to the get_user_profile_fields() function in grade/lib.php, which will continue over a field if the field is either hidden or not in an array of user default fields. The user default fields are defined by the user_get_default_fields() in user/lib.php. That function has a hardcoded list of fields and none of the new-in-2.6 additional names fields are in that list, so none of them can be included in grade exports.
Steps to reproduce:
- Go to Site admin > Grades > General Settings and add the alternatename field to grade_export_userprofilefields.
- Go to Site admin > Users > Permissions > User Policies and change the fullnamedisplay setting to "firstname lastname (alternatename)".
- Go to any course with enrolled users and grade items.
- Make sure that at least one enrolled user in a course has an Alternate Name set in the user profile.
- View the gradebook for the course. Note that users with an alternate name have the alternate name display in the gradebook.
- Export grades for this course to CSV (or Excel or whatever).
Expected result: The alternatename field should be included in the exported file.
Actual result: The alternatename field is not included in the exported file.
As a test, I added the alternatename field to the list of fields in user_get_default_fields() and exported again. The field was included in the exported file as expected. However, since I don't know how else that function is used, I don't know if this is the right fix.
- duplicates
-
MDL-44939 grade_export_userprofilefields does not display any additional fields
-
- Reopened
-