Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-38035

Display custom profile field names in conditional activities with multilang support

XMLWordPrintable

    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE
    • MDL-38035-master
    • Hide

      0.

      • In system settings/Plugins/Filters/Manage filters, turn on the multilang filter. Set it to apply to both headings and content.
      • In system settings/Advanced features, make sure conditional availability is enabled.
      • This test assumes your language is English, otherwise change the text below.

      1. In system settings/Users/Accounts/User profile fields, create a new Text profile field with the following settings:

      • Short name: multilangfield
      • Name: <span lang="en" class="multilang">English</span><span lang="fr" class="multilang">Francais</span>
        (Other values can be left default.)

      Note that the field name is correctly displayed as 'English' in the user profile field list.

      2. Go to any course website.
      3. Turn editing on.
      4. Add an activity or resource / Label.
      5. In 'Restrict access' section, open dropdown 'User field'.

      EXPECTED: User field list should include the field 'English'.
      BEFORE FIX: User field list includes 'EnglishFrancais'.

      6. Edit settings for any section in the website.
      7. In 'Restrict access' section, open dropdown 'User field'.

      EXPECTED: User field list should include the field 'English'.
      BEFORE FIX: User field list includes 'EnglishFrancais'.

      8. From the course page, add a new Forum activity with default settings except that, in 'Restrict access' section, open dropdown 'User field' and select that the 'English' field must have value 'Frog'. Save changes.

      9. View course page. Check the informational text below the activity that was just added.

      EXPECTED: Text should read: 'Restricted: Not available unless your English contains frog.'
      BEFORE FIX: Text reads: 'Restricted: Not available unless your EnglishFrancais contains frog.'

      10. Log in using a test student account. Check the same message.

      EXPECTED: Text should read: 'Not available unless your English contains frog.'
      BEFORE FIX: Text reads: 'Not available unless your EnglishFrancais contains frog.'

      Show
      0. In system settings/Plugins/Filters/Manage filters, turn on the multilang filter. Set it to apply to both headings and content. In system settings/Advanced features, make sure conditional availability is enabled. This test assumes your language is English, otherwise change the text below. 1. In system settings/Users/Accounts/User profile fields, create a new Text profile field with the following settings: Short name: multilangfield Name: <span lang="en" class="multilang">English</span><span lang="fr" class="multilang">Francais</span> (Other values can be left default.) Note that the field name is correctly displayed as 'English' in the user profile field list. 2. Go to any course website. 3. Turn editing on. 4. Add an activity or resource / Label. 5. In 'Restrict access' section, open dropdown 'User field'. EXPECTED: User field list should include the field 'English'. BEFORE FIX: User field list includes 'EnglishFrancais'. 6. Edit settings for any section in the website. 7. In 'Restrict access' section, open dropdown 'User field'. EXPECTED: User field list should include the field 'English'. BEFORE FIX: User field list includes 'EnglishFrancais'. 8. From the course page, add a new Forum activity with default settings except that, in 'Restrict access' section, open dropdown 'User field' and select that the 'English' field must have value 'Frog'. Save changes. 9. View course page. Check the informational text below the activity that was just added. EXPECTED: Text should read: 'Restricted: Not available unless your English contains frog.' BEFORE FIX: Text reads: 'Restricted: Not available unless your EnglishFrancais contains frog.' 10. Log in using a test student account. Check the same message. EXPECTED: Text should read: 'Not available unless your English contains frog.' BEFORE FIX: Text reads: 'Not available unless your EnglishFrancais contains frog.'

      We have some custom user profile fields with multilang names in Moodle. These multilang strings have worked well until now. Now, within the new feature "Conditional user fields" (http://docs.moodle.org/24/en/Conditional_user_fields), these profile fields are visible to all Moodle teachers.

      Unfortunately, the custom user profile field names aren't processed with the format_string() function, therefore all languages are visible in the dropdown box (see screenshot for details).

      It would be great if you could display custom profile field names in conditional activities with multilang support.

      Thanks in advance,
      Alex

            quen Sam Marshall
            abias Alexander Bias
            Sam Hemelryk Sam Hemelryk
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.