Uploaded image for project: '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
    • Status: Closed
    • Priority: 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

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              quen 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
              quen 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:
                  quen Sam Marshall
                  Reporter:
                  quen Sam Marshall
                  Tester:
                  Nobody
                  Participants:
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Mar/10