Moodle
  1. Moodle
  2. MDL-21567

At module level, 'Assign roles' screens display user twice if they have two roles at course level

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26569

      Description

      To reproduce:

      1) Set up a course if required.
      2) Add a single user to two roles on that course (e.g. Student, Non-Editing Teacher)
      3) Create any activity on that course e.g. forum.
      4) Edit the forum settings and click to the roles tab. Click on a role type to assign, e.g. Student again.

      Expected result:

      The user who was added to the course should appear once in the list of potential candidates to be added to the role.

      Actual result:

      The user appears twice.

        Issue Links

          Activity

          Hide
          Sam Marshall added a comment -

          I resolved this by adding a DISTINCT to the query. After checking through the logic in Moodle 2, which is significantly different, I noted that the final query used in Moodle 2 (in function potential_assignees_below_course) already has a DISTINCT added to it, so I don't think this change should be controversial...

          Show
          Sam Marshall added a comment - I resolved this by adding a DISTINCT to the query. After checking through the logic in Moodle 2, which is significantly different, I noted that the final query used in Moodle 2 (in function potential_assignees_below_course) already has a DISTINCT added to it, so I don't think this change should be controversial...

            People

            • Assignee:
              Sam Marshall
              Reporter:
              Sam Marshall
              Tester:
              Nobody
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: