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

The find users autocomplete in the Enrol user pop-up should respect get_extra_user_fields

    XMLWordPrintable

Details

    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-64031-master
    • Hide

      Setup

      1. Login as an admin.
      2. Navigate to "Users > Permissions > User policies " in site administration.
      3. Go to "Show user identity" and check, at least, City/town and Country checkboxes.
      4. Navigate to " Users > Accounts > Browse list of users" in site administration.
      5. Edit one user profile to make sure the City/town and Country fields are not empty.

      Testing scenario

      1. Login as a teacher.
      2. Go to the Course home page.
      3. Go to the Participants page.
      4. Click the 'Enrol users' button.
      5. Fill 'Select users' and search for the user with the filled City/town and Country fields.
      6. CHECK the City/town and Country information is displayed for the searched user (the one edited during the setup).
      Show
      Setup Login as an admin. Navigate to "Users > Permissions > User policies " in site administration. Go to "Show user identity" and check, at least, City/town and Country checkboxes. Navigate to " Users > Accounts > Browse list of users" in site administration. Edit one user profile to make sure the City/town and Country fields are not empty. Testing scenario Login as a teacher. Go to the Course home page. Go to the Participants page. Click the 'Enrol users' button. Fill 'Select users' and search for the user with the filled City/town and Country fields. CHECK the City/town and Country information is displayed for the searched user (the one edited during the setup).

    Description

      The user fields shown in the Enrol users pop-up should respect the $CFG->showuseridentity setting, even if that includes columns that cannot be chosen in the admin UI. E.g. if you have $CFG->showuseridentity = 'idnumber,username'; in config.php.

      However, in https://github.com/moodle/moodle/blob/master/enrol/manual/amd/src/form-potential-user-selector.js#L81, there is a hard-coded list of user fields. That should not be.

      The way to access this list of fields to show in addtion to fullname($user) is get_extra_user_fields() in PHP code. That needs to be passed through to the JS somehow.

      Attachments

        1. MDL-64031.jpg
          20 kB
          Anna Carissa Sadia
        2. screenshot-1.png
          9 kB
          Tim Hunt

        Issue Links

          Activity

            People

              thếvinhlê Vinh.Le
              timhunt Tim Hunt
              Tim Hunt Tim Hunt
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Anna Carissa Sadia Anna Carissa Sadia
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Mar/19

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m