1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 18:04:43 +02:00
This commit is contained in:
Jun Pataleta 2022-06-23 09:51:50 +08:00
commit 79b54a59a4
3 changed files with 17 additions and 2 deletions
admin/settings
badges/criteria
lib/tests/behat

@ -240,7 +240,8 @@ if ($hassiteconfig
if ($field->param2 > 255 || $field->datatype != 'text') {
continue;
}
$fields['profile_field_' . $field->shortname] = $field->name . ' *';
$fields['profile_field_' . $field->shortname] = format_string($field->name, true,
['context' => context_system::instance()]) . ' *';
}
return $fields;

@ -117,7 +117,8 @@ class award_criteria_profile extends award_criteria {
if (in_array($field->id, $existing)) {
$checked = true;
}
$this->config_options($mform, array('id' => $field->id, 'checked' => $checked, 'name' => $field->name, 'error' => false));
$this->config_options($mform, array('id' => $field->id, 'checked' => $checked,
'name' => format_string($field->name), 'error' => false));
$none = false;
}
}

@ -32,6 +32,19 @@ Feature: Select user identity fields
And I press "Save changes"
And the field "Speciality" matches value "1"
Scenario: The admin settings screen correctly formats custom field names
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And the following "custom profile field" exists:
| datatype | text |
| name | <span class="multilang" lang="en">Field (EN)</span><span class="multilang" lang="de">Field (DE)</span> |
| shortname | stuff |
| param2 | 100 |
When I log in as "admin"
And I navigate to "Users > Permissions > User policies" in site administration
Then I should see "Field (EN)" in the "#admin-showuseridentity" "css_element"
And I should not see "Field (DE)" in the "#admin-showuseridentity" "css_element"
Scenario: When you choose custom fields, these should be displayed in the 'Browse list of users' screen
Given the following config values are set as admin:
| showuseridentity | username,department,profile_field_speciality |