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

Custom user profile field names not processed through Moodle filters in Browse List of Users

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.9.11, 3.10.8, 3.11.4, 3.11.7, 4.0.1
    • 3.11.8, 4.0.2
    • User management
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MDL-73156-M311
    • MDL-73156-M400
    • MDL-73156-master
    • Hide

      These instructions assume that Moodle was installed in English.

      1. Login to Moodle as a site administrator.
      2. Install the French language pack. You can find instructions on how to do that by going to https://docs.moodle.org/en/Language_packs.
      3. Activate Multi-Language Content filter navigating to Site administration > Plugins > Filters > Manage filters
      4. Switch 'Multi-Language Content' filter to 'On' on 'Active' column and 'Content and headings' on 'Apply to' column.
      5. Navigate to Site Administration > Users > Accounts > User profile fields.
      6. Create a new Text Input profile field.
        1. Shortname: location.
        2. Name: <span lang="en" class="multilang">Location</span><span lang="fr" class="multilang">Endroit</span>
        3. Save.
      7. Navigate to Site Administration > Users > Accounts > Browse List of Users.
      8. Use the Show More... link to display additional filter criteria.
      9. VERIFY: For User Profile Fields, look for the field called "Location".
      10. Select the Location field.
      11. Change "Contains" to "is empty".
      12. Click the "Add filter" button.
      13. VERIFY: In the "Active Filters" section, the checkbox field should say "User profile field: Location is empty".
      Show
      These instructions assume that Moodle was installed in English. Login to Moodle as a site administrator. Install the French language pack. You can find instructions on how to do that by going to https://docs.moodle.org/en/Language_packs . Activate Multi-Language Content filter navigating to Site administration > Plugins > Filters > Manage filters Switch 'Multi-Language Content' filter to 'On' on 'Active' column and 'Content and headings' on 'Apply to' column. Navigate to Site Administration > Users > Accounts > User profile fields. Create a new Text Input profile field. Shortname: location. Name: <span lang="en" class="multilang">Location</span><span lang="fr" class="multilang">Endroit</span> Save. Navigate to Site Administration > Users > Accounts > Browse List of Users. Use the Show More... link to display additional filter criteria. VERIFY: For User Profile Fields, look for the field called "Location". Select the Location field. Change "Contains" to "is empty". Click the "Add filter" button. VERIFY: In the "Active Filters" section, the checkbox field should say " User profile field: Location is empty ".

    Description

      Although they are processed through Moodle filters in most places in Moodle, the names of custom User Profile Fields are not passed through Moodle filters in the Browser List of Users. As a result, attempts to create custom profile fields with multi-language names display all languages.

      In the following example, I am using the Multi-Language Content (v2) "{mlang} tags to create a user profile field called "Location" in English and "Endroit" in French. Using {mlang} tags, the name of the tag is:

      In the Browse List of Users, the result is as follows. Note that it is not filtered in the New Filter (1) section and the Active Filters (2) section.

      Let me know if you have any questions.

      Michael Milette

      Attachments

        1. image-2021-11-24-10-47-58-020.png
          image-2021-11-24-10-47-58-020.png
          43 kB
        2. image-2021-11-24-10-49-09-889.png
          image-2021-11-24-10-49-09-889.png
          1 kB
        3. MDL-73156_master.webm
          658 kB
        4. MDL-73156_v311.webm
          1.07 MB
        5. MDL-73156_v400.webm
          584 kB

        Issue Links

          Activity

            People

              michael-milette Michael Milette
              michael-milette Michael Milette
              Ilya Tregubov Ilya Tregubov
              Amaia Anabitarte Amaia Anabitarte
              Angelia Dela Cruz Angelia Dela Cruz
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Jul/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 25 minutes
                  4h 25m