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

Enrol user popup - Erratic behavior of the auto-complete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 3.4.2, 3.5.1
    • Fix Version/s: None
    • Component/s: Enrolments, JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      Regression testing is covered by the enrol_manual behat tests

      Setup

      This test requires that we have requests that take a much longer time to complete that later requests would, to simulate that we will modify the core_enrol_get_potential_users external function to take a minimum of 10 seconds. We will do that by adding the following lines of code to the get_potential_users method in /enrol/externallib.php:

      if (strlen($search) === 1) {
          sleep(10);
      }
      

      You can use one of the attached patch files to do this:

      1. For master: MDL-62194-master-simulate-long-request.diff
      2. For Moodle 3.4 and 3.5: MDL-62194-MOODLE_35_STABLE-and-MOODLE_£$_STABLE-simulate-long-request.diff

      Prerequisites

      • A course (Course 1)
      • An Teacher enrolled on Course 1
      • Three users that have a matching start character in their name but then differentiate:
        • Jane Eyre
        • John Smith
        • James Peach

      Testing that the autocomplete works

      1. Navigate to the Course 1 as Teacher
      2. In the hamburger menu select Participants
      3. Press Enrol users
      4. In the Select users search box start typing J
      5. Wait a second or two
      6. Then type ane so that the text in the box is Jane
      7. Stop typing
      8. Around 10 seconds after you completed step 4 you should see a list of users containing Jane Eyre, John Smith and James Peach (It may only show for half a second)
      9. Shortly after this the list of users should change to display Jane Eyre, verify that it no longer displays John Smith nor James Peach
      Show
      Regression testing is covered by the enrol_manual behat tests Setup This test requires that we have requests that take a much longer time to complete that later requests would, to simulate that we will modify the core_enrol_get_potential_users external function to take a minimum of 10 seconds. We will do that by adding the following lines of code to the get_potential_users method in /enrol/externallib.php: if ( strlen ( $search ) === 1) { sleep(10); } You can use one of the attached patch files to do this: For master: MDL-62194-master-simulate-long-request.diff For Moodle 3.4 and 3.5: MDL-62194-MOODLE_35_STABLE-and-MOODLE_£$_STABLE-simulate-long-request.diff Prerequisites A course ( Course 1 ) An Teacher enrolled on Course 1 Three users that have a matching start character in their name but then differentiate: Jane Eyre John Smith James Peach Testing that the autocomplete works Navigate to the Course 1 as Teacher In the hamburger menu select Participants Press Enrol users In the Select users search box start typing J Wait a second or two Then type ane so that the text in the box is Jane Stop typing Around 10 seconds after you completed step 4 you should see a list of users containing Jane Eyre , John Smith and James Peach (It may only show for half a second) Shortly after this the list of users should change to display Jane Eyre , verify that it no longer displays John Smith nor James Peach
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
      MDL-62194-m35
    • Pull 3.6 Branch:
      MDL-62194-m36
    • Pull Master Branch:

      Description

      In our installation we got about 139 000 users in our database. When we search a user to add it manually we use the auto-complete feature. This feature is not as good as it should.

      • Sometime you got the wrong answer if you make some typo during the search and if you erase characters
      • If you check the network debugger of your browser you see a lot of web service call. The result don't come in the right order.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: