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

Duplicate get_records key column in users selector

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Pre-requisites: To have "display errors" enabled and debugging level to DEBUG_DEVELOPER (both being admin settings)

      1. Create a course
      2. Enrol a user twice (for example manual and cohort, or self and manual enrolment methods)
      3. From the Administration block, select Course Administration > Users > Permissions > Check Permissions
      4. You should not get any debugging messages and should see each enrolled user once
      Show
      Pre-requisites: To have "display errors" enabled and debugging level to DEBUG_DEVELOPER (both being admin settings) Create a course Enrol a user twice (for example manual and cohort, or self and manual enrolment methods) From the Administration block, select Course Administration > Users > Permissions > Check Permissions You should not get any debugging messages and should see each enrolled user once
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_28_STABLE, MOODLE_31_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull Master Branch:

      Description

      To replicate:

      Enrol same user in course via different enrolment methods. In this case, I had enrolled the user into the course via a cohort as a student and manually added them as a teacher.

      From the Administration block, select 'Course Administration > Users > Permissions > Check Permissions'

      The following debug message is displayed on screen:

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '5' found in column 'id'.

      line 1005 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
      line 121 of /admin/roles/classes/check_users_selector.php: call to mysqli_native_moodle_database->get_records_sql()
      line 210 of /user/selector/lib.php: call to core_role_check_users_selector->find_users()
      line 171 of /admin/roles/check.php: call to user_selector_base->display()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pholden Paul Holden
                Reporter:
                pholden Paul Holden
                Peer reviewer:
                Jake Dallimore
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Janelle Barcega
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 52 minutes
                  52m