mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-38129 gradeexport: custom profile fields case problem
Do not use custom pfofile field name as a field alias in DB query, use field id instead. DML lowercases all column aliases and fields with uppercase letters no longer match.
This commit is contained in:
parent
16a68a2f76
commit
1ef14a5aec
@ -191,7 +191,7 @@ class graded_users_iterator {
|
||||
LEFT JOIN (SELECT * FROM {user_info_data}
|
||||
WHERE fieldid = :cf$customfieldscount) cf$customfieldscount
|
||||
ON u.id = cf$customfieldscount.userid";
|
||||
$userfields .= ", cf$customfieldscount.data AS customfield_{$field->shortname}";
|
||||
$userfields .= ", cf$customfieldscount.data AS customfield_{$field->customid}";
|
||||
$params['cf'.$customfieldscount] = $field->customid;
|
||||
$customfieldscount++;
|
||||
}
|
||||
@ -3191,7 +3191,7 @@ abstract class grade_helper {
|
||||
*/
|
||||
public static function get_user_field_value($user, $field) {
|
||||
if (!empty($field->customid)) {
|
||||
$fieldname = 'customfield_' . $field->shortname;
|
||||
$fieldname = 'customfield_' . $field->customid;
|
||||
if (!empty($user->{$fieldname}) || is_numeric($user->{$fieldname})) {
|
||||
$fieldvalue = $user->{$fieldname};
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user