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

Admin user search should also search without whitespace

    XMLWordPrintable

Details

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-74435-master
    • Hide

      Setup

      A site with few users (can be existing)

      Test

      1. As admin, go to Site administration > Users > Accounts > Browse list of users
      2. Choose a user in the users list table.
      3. Add a "User full name" filter setting the operator as contains and the filter text to the user followed by a space, eg. " John"
      4. Make sure the user you choose appear in the search results.
      5. Under "Active filters" section, click "Remove all filters" button.
      6. Repeat the test above, with another fields such as "City/town" adding a space before the search text, eg. " Liverpool".
      7. Make sure the result is displayed.
      8. Repeat the user name test, but this time set the operator to "is equal to".
      9. This time, make sure the user is not displayed in the search filter.
      Show
      Setup A site with few users (can be existing) Test As admin, go to Site administration > Users > Accounts > Browse list of users Choose a user in the users list table. Add a "User full name" filter setting the operator as contains and the filter text to the user followed by a space, eg. " John" Make sure the user you choose appear in the search results. Under "Active filters" section, click "Remove all filters" button. Repeat the test above, with another fields such as "City/town" adding a space before the search text, eg. " Liverpool". Make sure the result is displayed. Repeat the user name test, but this time set the operator to "is equal to". This time, make sure the user is not displayed in the search filter.

    Description

      It can be common when performing user maintenance, investigations or other admin that you will copy paste usernames, emails or full names from other sources such as a support email, and paste into admin/user.php. It is common enough to have the copied string contain a leading or trailing space, which will cause a search fail.

      Anything except the exact comparison operator should have any trailing or leading whitespace stripped, as it will all result in a greater subset of useful results appearing, while still capturing all the matches for the exact search term as well.

      Attachments

        1. 4_MDL-74435_master.png
          4_MDL-74435_master.png
          23 kB
        2. 7_MDL-74435_master.png
          7_MDL-74435_master.png
          20 kB
        3. 9_MDL-74435_master.png
          9_MDL-74435_master.png
          12 kB
        4. MDL-74435.png
          MDL-74435.png
          8 kB

        Activity

          People

            peterburnett Peter Burnett
            peterburnett Peter Burnett
            Andrew Madden Andrew Madden
            Simey Lameze Simey Lameze
            John Edward Pedregosa John Edward Pedregosa
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 33 minutes
                2h 33m

                Clockify

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