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

restore creates invalid course completion records

    Details

    • Testing Instructions:
      Hide

      Enable Course completion inside a course
      Make sure some users are set to have a complete course (manual completion options work well)
      run cron a few times to make sure completion status is set correctly.
      Backup the course.
      Restore the course by using the "merge" into existing course option.
      Run cron - fatal error is shown.

      NOTE TO QA/tester: I had issues using the merge course under Postgres - threw some index errors related to grades - I did my testing on mysql which restored the course fine. (probably another bug there somewhere that needs further investigation.)

      Show
      Enable Course completion inside a course Make sure some users are set to have a complete course (manual completion options work well) run cron a few times to make sure completion status is set correctly. Backup the course. Restore the course by using the "merge" into existing course option. Run cron - fatal error is shown. NOTE TO QA/tester: I had issues using the merge course under Postgres - threw some index errors related to grades - I did my testing on mysql which restored the course fine. (probably another bug there somewhere that needs further investigation.)
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      master_MDL-32102

      Description

      If you merge a course that has existing course completion records you can end up with multiple course completion records in the db which throws this error in cron:

      !!! Found more than one record in fetch() ! !!!
      !! Stack trace: * line 429 of /lib/setuplib.php: moodle_exception thrown

      line 130 of /lib/completion/data_object.php: call to print_error()
      line 83 of /lib/completion/completion_aggregation.php: call to data_object::fetch_helper()
      line 65 of /lib/completion/data_object.php: call to completion_aggregation::fetch()
      line 374 of /lib/completionlib.php: call to data_object->__construct()
      line 308 of /lib/completion/cron.php: call to completion_info->get_aggregation_method()
      line 45 of /lib/completion/cron.php: call to completion_cron_completions()
      line 173 of /lib/cronlib.php: call to completion_cron()
      line 85 of /admin/cron.php: call to cron_run()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/12