-
Bug
-
Resolution: Done
-
Critical
-
None
-
2.5.2, 2.6, 2.7.10, 3.1.9, 3.2.6, 3.3.3, 3.4, 3.5, 3.6.5, 3.7.1, 3.8
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MDL-43587-master -
I am trying to add a Title/Salutation field to the User Profile form. I created a Menu of Choice type field called "salutation" and added the following multilingual content (I am using the multilingual filter):
{mlang en}Mr.{mlang}{mlang fr}M{mlang}
|
{mlang en}Mrs.{mlang}{mlang fr}Mme{mlang}
|
{mlang en}Ms.{mlang}{mlang fr}Mlle{mlang}
|
{mlang en}Dr.{mlang}{mlang fr}Dr{mlang}
|
Everything works great except that the information saved to the database table only includes one language. As a result, when the information is later displayed, it appears only in the language in which the UI was set to at the time the information was saved. For example, if I select Mr. and then view the profile, it will correctly show Mr.. However if I then switch to the French view of the page, the salutation field will still show Mr. instead of M.
The expected behaviour is that the information saved in the table be exactly what was entered in the "Menu Options (one per line)" field so that, anytime it is displayed, it will show up in the correct language whether the UI is set to English or French.
I started tracing through the Moodle code. From what I can see, the full multilingual string should be stored in the custom field because only the value (a number) is ever submitted. Upon submission, the PHP code uses that number to look up the corresponding line. Unfortunately somewhere along the line (I haven't figured out where yet), a filter seems to be applied before the information is stored in the table.
- has a non-specific relationship to
-
MDL-21845 [PATCH] Multilang filter is not applied to custom field labels in user profile
-
- Closed
-