Moodle

User lang default set to 'en' in db.

Details

  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The the core database definitions for the user table, the lang field is given a default of 'en'. The problem with that is that this is no longer a valid language selection, so if the user edits their profile (and doesn't notice), their language is changed to whatever is first in the list (in our case, German).

Now a user created with the moodle forms doesn't have this problem, because the creation script should set it to the site default - but there are a number of modules, like mine (Banner/LMB) and I believe LDAP that don't specify it on db insert, causing the database to use the hard coded default.

It seems to me that either the definition should be updated to reflect the new 'core' default language (en_utf8), or the profile page should be changed so that if a users language is not a valid selection, the site default is selected instead of the top most language (or maybe 'promote' the default to the top of the list all the time?)

That last option would also alleviate confusion if a user is using a language pack that is then removed from the system.

Issue Links

Activity

Hide
Eric Merrill added a comment - - edited

Just found this one, which is a specific subset of the issue as a whole. MDL-11829

Show
Eric Merrill added a comment - - edited Just found this one, which is a specific subset of the issue as a whole. MDL-11829
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Eric,

FYI I've upgraded database to have 'en_utf8' default instead of deprecated 'en'. Changes applied to 19_STABLE and HEAD.

I leave this open because I'm reviewing the language selection in user profile edition page, to see if we can make it slightly "clever" (and provide automatic "xx" ==> "xx_utf8" conversion).

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Eric, FYI I've upgraded database to have 'en_utf8' default instead of deprecated 'en'. Changes applied to 19_STABLE and HEAD. I leave this open because I'm reviewing the language selection in user profile edition page, to see if we can make it slightly "clever" (and provide automatic "xx" ==> "xx_utf8" conversion). Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Now the profile edition forms are able to detect non-utf8 langs and automatically append '_utf8' to them before continue processing the display of the form. That way, 'en_utf8' will be used for old-remaining 'en' records.

Resolving this as fixed. Thanks for report, Eric!

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now the profile edition forms are able to detect non-utf8 langs and automatically append '_utf8' to them before continue processing the display of the form. That way, 'en_utf8' will be used for old-remaining 'en' records. Resolving this as fixed. Thanks for report, Eric! Ciao
Hide
Eric Merrill added a comment -

WOW, thanks for the fast and great work on this!!!

-eric

Show
Eric Merrill added a comment - WOW, thanks for the fast and great work on this!!! -eric
Hide
Dongsheng Cai added a comment -

Thanks, Eloy, closing

Show
Dongsheng Cai added a comment - Thanks, Eloy, closing

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: