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

Duplicate value warning on course participants report

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.6.3, 2.7
    • Fix Version/s: 2.6.4, 2.7.1
    • Component/s: Reports
    • Labels:
    • Testing Instructions:
      Hide
      • Create one course, one activity and one user
      • Also, create a cohort
      • Assign the user to the created cohort
      • Enrol the user in the created course with manual enrol and give the student role
      • Add a cohort sync enrol method to the created course to sync users from the created cohort with student role
      • Enable debug at developer level and debug display
      • Go to Administration block -> Course administration -> Reports -> Course participation
      • Confirm that you do not get an error like this:

        Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'userid'.
         
            line 1023 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
            line 259 of /report/participation/index.php: call to mysqli_native_moodle_database->get_records_sql()
        

      Show
      Create one course, one activity and one user Also, create a cohort Assign the user to the created cohort Enrol the user in the created course with manual enrol and give the student role Add a cohort sync enrol method to the created course to sync users from the created cohort with student role Enable debug at developer level and debug display Go to Administration block -> Course administration -> Reports -> Course participation Confirm that you do not get an error like this : Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'userid'.   line 1023 of /lib/dml/mysqli_native_moodle_database.php: call to debugging() line 259 of /report/participation/index.php: call to mysqli_native_moodle_database->get_records_sql()
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      I got a warning when accessing the course participation report.

      Replication steps:

      1. Log in as teacher/admin
      2. Navigate to a course that has multiple students enrolled
      3. Navigate to the course participantion report (Navigation > somecourse > reports > course participation)
      4. from course participant list above, select an activity.
      5. Select Student from the Show only list.
      6. Click Go

      That caused the following error to be displayed.

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '2' found in column 'userid'.
       
          line 979 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
          line 259 of /report/participation/index.php: call to mysqli_native_moodle_database->get_records_sql()
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danielneis Daniel Neis Araujo
              Reporter:
              andyjdavis Andrew Davis
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              Marina Glancy
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14