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

get_role_users() (lib/accesslib.php) can return duplicate IDs.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.7.3
    • Enrolments
    • None
    • MOODLE_27_STABLE

      If a user has two roles in a course and you call get_role_users method with an array containing both those role IDs, it will throw a DB error:
      'Did you remember to make the first column something unique in your call to get_records? Duplicate value 'xx' found in column 'id'.'

      This is because the SELECT DISTINCT will not separate out the two rows as the roleid is different (MySQL).
      You could group by the u.id but you may want to return both roles?..

            Unassigned Unassigned
            skylarkelty Skylar Kelty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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