Skip to content

Commit

Permalink
MDL-61658 user: Fix displaying of user's country name
Browse files Browse the repository at this point in the history
In these cases we want to use the method get_list_of_countries() to
obtain translated names of all potential country codes. The country code
is already there in the database. So it does not matter if the country
is among those whitelisted in $CFG->allcountrycodes - we want to see its
name anyway.
  • Loading branch information
mudrd8mz committed Mar 21, 2018
1 parent a3ef470 commit c3ab217
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion admin/user.php
Expand Up @@ -246,7 +246,7 @@

} else {

$countries = get_string_manager()->get_list_of_countries(false);
$countries = get_string_manager()->get_list_of_countries(true);
if (empty($mnethosts)) {
$mnethosts = $DB->get_records('mnet_host', null, 'id', 'id,wwwroot,name');
}
Expand Down
2 changes: 1 addition & 1 deletion blocks/myprofile/block_myprofile.php
Expand Up @@ -75,7 +75,7 @@ public function get_content() {
$this->content->text .= '<div class="myprofileitem fullname">'.fullname($USER).'</div>';

if(!isset($this->config->display_country) || $this->config->display_country == 1) {
$countries = get_string_manager()->get_list_of_countries();
$countries = get_string_manager()->get_list_of_countries(true);
if (isset($countries[$USER->country])) {
$this->content->text .= '<div class="myprofileitem country">';
$this->content->text .= get_string('country') . ': ' . $countries[$USER->country];
Expand Down
2 changes: 1 addition & 1 deletion user/classes/participants_table.php
Expand Up @@ -226,7 +226,7 @@ public function __construct($courseid, $currentgroup, $accesssince, $roleid, $en
$this->enrolid = $enrolid;
$this->status = $status;
$this->selectall = $selectall;
$this->countries = get_string_manager()->get_list_of_countries();
$this->countries = get_string_manager()->get_list_of_countries(true);
$this->extrafields = $extrafields;
$this->context = $context;
if ($canseegroups) {
Expand Down

0 comments on commit c3ab217

Please sign in to comment.