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

Completion Info reset state throws debugging error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3
    • Component/s: Activity completion
    • Labels:
    • Testing Instructions:
      Hide

      Note: The actual bug that occurs, for some reason I don't understand I haven't been able to reproduce it without using the OU's custom dual pane module. However, I did test this fix against that and it works. These test instructions exercise the activity completion report, because that page uses the functions I changed - just to make sure I didn't break it.

      1. Set up a new course website. Ensure that completion is enabled.

      2. Enrol two test users as students in the course.

      3. Add a Label with text 'Ticky ticky' and manual completion enabled.

      4. While logged in as admin (or another user who is not enrolled on the course), tick the box.

      5. Log in as the first user who is enrolled on the course, and tick the box.

      6. Log back in as admin (or whoever) and view the 'Activity completion' report for the course.

      • The list of users should show both of the enrolled students (one of whom has ticked the box and the other hasn't).
      • It should not show the admin/unenrolled user.

      7. Using the 'First name' selector at the top, click to different values (one which does not match any user names; one which does) and ensure the result is as expected

      Show
      Note: The actual bug that occurs, for some reason I don't understand I haven't been able to reproduce it without using the OU's custom dual pane module. However, I did test this fix against that and it works. These test instructions exercise the activity completion report, because that page uses the functions I changed - just to make sure I didn't break it. 1. Set up a new course website. Ensure that completion is enabled. 2. Enrol two test users as students in the course. 3. Add a Label with text 'Ticky ticky' and manual completion enabled. 4. While logged in as admin (or another user who is not enrolled on the course), tick the box. 5. Log in as the first user who is enrolled on the course, and tick the box. 6. Log back in as admin (or whoever) and view the 'Activity completion' report for the course. The list of users should show both of the enrolled students (one of whom has ticked the box and the other hasn't). It should not show the admin/unenrolled user. 7. Using the 'First name' selector at the top, click to different values (one which does not match any user names; one which does) and ensure the result is as expected
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-32107-master

      Description

      On one Moodle course, when updating a module I am seeing the following error -

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '333182' found in column 'id'.
      
          line 716 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
          line 1094 of /lib/completionlib.php: call to pgsql_native_moodle_database->get_records_sql()
          line 786 of /lib/completionlib.php: call to completion_info->get_tracked_users()
          line 391 of /course/modedit.php: call to completion_info->reset_all_state()
      
      Did you remember to make the first column something unique in your call to get_records? Duplicate value '339734' found in column 'id'.
      
          line 716 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
          line 1094 of /lib/completionlib.php: call to pgsql_native_moodle_database->get_records_sql()
          line 786 of /lib/completionlib.php: call to completion_info->get_tracked_users()
          line 391 of /course/modedit.php: call to completion_info->reset_all_state()
      
      Did you remember to make the first column something unique in your call to get_records? Duplicate value '407824' found in column 'id'.
      
          line 716 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
          line 1094 of /lib/completionlib.php: call to pgsql_native_moodle_database->get_records_sql()
          line 786 of /lib/completionlib.php: call to completion_info->get_tracked_users()
          line 391 of /course/modedit.php: call to completion_info->reset_all_state()
      

      I have attempted reproducing and replicating the error but haven't succeeded.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12