Affects Version/s: 2.2.6
- Install Moodle 1.9, install a lang pack (french)
- Create some courses and set the course language to french
- Upgrade to 2.2
- Verify that the courses have been upgraded and the french language is set
For testing >2.2 :
1/ before upgrade edit the course table to contain en_utf8 in lang fields
3/ verify the _utf8 was strippedInstall Moodle 1.9, install a lang pack (french) Create some courses and set the course language to french Upgrade to 2.2 Verify that the courses have been upgraded and the french language is set For testing >2.2 : 1/ before upgrade edit the course table to contain en_utf8 in lang fields 2/ upgrade 3/ verify the _utf8 was stripped
Fixed Branches:MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
Pull from Repository:
Pull Master Branch:w50_
Pull Master Diff URL:
We upgraded our site from Moodle 1.9 to 2.2.
This issue applies to all language packs although for convenience only English is discussed here.
Steps to reproduce:
- Set course's mdl_course.lang to en_utf8 (language code format inherited from 1.9)
- Go to course's "Edit course settings" page
"Force language" displays "English (en)".
"Force language" displays "Do not force".
On the course level, force language works. All strings are displayed in English as expected, regardless of the sitewide language settings. Unfortunately this is not reflected on the course settings page.
Apparently the dropdown on the course settings page expects the language code to be 'en', not 'en_utf8' as in version 1.9.
If lang is 'en_utf8', 'Do not force' is set in the dropdown.
This is problematic since forced language will get unset (mdl_course.lang='') when course settings are saved.
We solved this problem for our site by replacing 'en_utf8' with 'en' (all other languages accordingly) in mdl_course.lang:
UPDATE mdl_course SET lang = 'en' WHERE lang='en_utf8';
This could probably be handled automatically when upgrading Moodle to version 2.x.