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

Users can be added to a group twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.3, 3.2.1, 3.6.1
    • Fix Version/s: 3.5.5, 3.6.3
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide

      Changes are made to the database during an upgrade. So begin your test in an unpatched version!

      1. Add "sleep(5);" into group/lib.php on line 100 to simulate a slow server.
      2. Navigate into a course with at least one enrolled user.
      3. Navigate to groups management and create a new, empty group.
      4. Select that group and click "Add/remove users"
      5. Open the same page you're at in a different browser.
      6. Select the same user on the right in both browsers.
      7. Quickly click "Add" in both browsers.
      8. Click "Back to groups".
      9. There should now be an incorrect member count, i.e. two members in the group "(2)" (remember: The patch must not have been applied before this step! Otherwise you will get a different result).
      10. Apply the patch and upgrade Moodle accordingly.
      11. Now there should be only one member in the group. "(1)".
      12. Repeat steps 2-8. With the patch, there should be only one member in the new group and one browser should have shown an error.
      Show
      Changes are made to the database during an upgrade. So begin your test in an unpatched version! Add "sleep(5);" into group/lib.php on line 100 to simulate a slow server. Navigate into a course with at least one enrolled user. Navigate to groups management and create a new, empty group. Select that group and click "Add/remove users" Open the same page you're at in a different browser. Select the same user on the right in both browsers. Quickly click "Add" in both browsers. Click "Back to groups". There should now be an incorrect member count, i.e. two members in the group "(2)" (remember: The patch must not have been applied before this step! Otherwise you will get a different result). Apply the patch and upgrade Moodle accordingly. Now there should be only one member in the group. "(1)". Repeat steps 2-8. With the patch, there should be only one member in the new group and one browser should have shown an error.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-58256-master

      Description

      The current group editing interface group/members.php allows adding a user to a group twice – if I am fast enough.

      Steps to reproduce:

      1. Navigate into a course with at least one enrolled user.
      2. Navigate to groups management and create a new, empty group
      3. Select that group and click "Add/remove users"
      4. Select a user on the right
      5. Quickly click "Add"
      6. Verify that on the left the added user is shown once (looks okay, but isn't)
      7. Click "Back to groups"
      8. Look at the entry for your group on the left. The number in the brackets indicates that two members are in that group.

       

       

        Attachments

        1. doublegroups.png
          doublegroups.png
          16 kB
        2. screenshot-1.png
          screenshot-1.png
          7 kB
        3. screenshot-2.png
          screenshot-2.png
          7 kB
        4. screenshot-3.png
          screenshot-3.png
          86 kB

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Mar/19