Moodle

Missing country field in user profile view

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.5, 1.9.1
  • Fix Version/s: 1.8.6, 1.9.2
  • Component/s: General
  • Labels:
    None
  • Environment:
    All. Problem appears on Mac & PC; on Firefox, IE7, Safari. Seen as browser and platform independent

Description

When viewing the Participants list in any course or via Site Administration, users are shown with User Picture, First Name/Last Name, City/Town, Country, Last access, Select.
When any user is selected the profile overview tab shows (if not hidden from the user) City/town, Email, Courses, Last access, Roles. However, except where Country is set to be a hidden field,
the City/town line ($location in user/view.php) should including the country field thus: City/town: Perth, Australia.
Problem appears to stem from a failure of the function call $countries = get_list_of_countries(); in same file.
Thread http://moodle.org/mod/forum/discuss.php?d=99362 refers.
To see problem click on your own profile link in Moodle forums on 1.9.1 (may also apply to 1.9 - uncertain).

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Hi Dongsheng, can you, plz take a look to this? TIA!

Show
Eloy Lafuente (stronk7) added a comment - Hi Dongsheng, can you, plz take a look to this? TIA!
Hide
Dongsheng Cai added a comment - - edited

Fixed in 1.8, 1.9 and head, please review, feel free to reopen it.

Show
Dongsheng Cai added a comment - - edited Fixed in 1.8, 1.9 and head, please review, feel free to reopen it.
Hide
Robert Allerstorfer added a comment -

Thank you Dongsheng for taking care about this so quickly!
Just looked into CVS - did you move the tags MOODLE_19_STABLE and MOODLE_18_STABLE?

Show
Robert Allerstorfer added a comment - Thank you Dongsheng for taking care about this so quickly! Just looked into CVS - did you move the tags MOODLE_19_STABLE and MOODLE_18_STABLE?
Hide
Robert Allerstorfer added a comment -

The current approach won't work well when "City/town" has been added to the "Hide user fields" array (in "Site Administration -> Users -> Permissions -> User policies"). Then, the above example would lead to display

City/town: , Australia

The attached patch treats both the country and city fields independent from each other, so all combinations specified as hidden user fields will work as expected.

regards,
rob.

Show
Robert Allerstorfer added a comment - The current approach won't work well when "City/town" has been added to the "Hide user fields" array (in "Site Administration -> Users -> Permissions -> User policies"). Then, the above example would lead to display City/town: , Australia The attached patch treats both the country and city fields independent from each other, so all combinations specified as hidden user fields will work as expected. regards, rob.
Hide
Dongsheng Cai added a comment -

Close again, Thanks robert.

Show
Dongsheng Cai added a comment - Close again, Thanks robert.
Hide
Robert Allerstorfer added a comment -

Dear Dongsheng,

now in case of having the example situation above, we would see:

City/town: Australia

That's confusing IMO (not to say wrong) - is Australia a city or town?

What's bad in separating the city from the country, as suggested in my patch?

Thanks for rethinking about it,
rob.

Show
Robert Allerstorfer added a comment - Dear Dongsheng, now in case of having the example situation above, we would see: City/town: Australia That's confusing IMO (not to say wrong) - is Australia a city or town? What's bad in separating the city from the country, as suggested in my patch? Thanks for rethinking about it, rob.
Hide
Petr Škoda (skodak) added a comment -

Syntax error from last commit fixed in HEAD.

Show
Petr Škoda (skodak) added a comment - Syntax error from last commit fixed in HEAD.
Hide
Dongsheng Cai added a comment -

Sorry, Robert, I didn't read your comment carefully, you are right, your patch applied.

Show
Dongsheng Cai added a comment - Sorry, Robert, I didn't read your comment carefully, you are right, your patch applied.
Hide
Robert Allerstorfer added a comment -

Now works perfectly, thanks Dongsheng

Show
Robert Allerstorfer added a comment - Now works perfectly, thanks Dongsheng

Dates

  • Created:
    Updated:
    Resolved: