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

Completion Info reset error not backported to 2.2

XMLWordPrintable

    • MOODLE_22_STABLE
    • Hide

      This is very tricky to reproduce through Moodle's UI, but here it goes:

      1. Turn on Activity Completion and enable completion for the course
      2. The admin setting gradebookroles, select more than one role
      3. In a course, enroll a user, assign both of the gradebookroles to that user
      4. Create an activity in that same course, like Page, use the default activity completion settings (EG: User can manually mark as complete)
      5. Edit the activity and change the activity completion settings (EG: Change to require view for completion)
      6. When hitting save, the debugging message should appear

      I haven't figured out how to duplicate through the UI when the user has multiple group assignments. I assume the above steps would work for enrollments if the user had more than one enrollment for the course.

      Show
      This is very tricky to reproduce through Moodle's UI, but here it goes: Turn on Activity Completion and enable completion for the course The admin setting gradebookroles, select more than one role In a course, enroll a user, assign both of the gradebookroles to that user Create an activity in that same course, like Page, use the default activity completion settings (EG: User can manually mark as complete) Edit the activity and change the activity completion settings (EG: Change to require view for completion) When hitting save, the debugging message should appear I haven't figured out how to duplicate through the UI when the user has multiple group assignments. I assume the above steps would work for enrollments if the user had more than one enrollment for the course.

      The error:

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'id'.
      line 818 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
      line 1104 of /lib/completionlib.php: call to mysqli_native_moodle_database->get_records_sql()
      line 795 of /lib/completionlib.php: call to completion_info->get_tracked_users()
      line 385 of /course/modedit.php: call to completion_info->reset_all_state()

      If you look at the SQL generated via completion_info::generate_tracked_user_sql() you can see that any user has more than one role assignment group membership or enrollment, then the SQL will return multiple records for that user.

            quen Sam Marshall
            bushido Mark Nielsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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