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

Error writing to database during restore when merging to the course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.5, 2.6.2
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      Test pre-requisites

      1. Create a new course with a few students
      2. Create a new assignment activity with some submissions
      3. Grade the submissions (from mod_assign, not the gradebook - give the grades 10, 20, 30, ...)
      4. Edit the course grade for a student, and add a feedback to it
      5. Backup the course leaving the default settings (user data included)

      Merge restore

      1. Go to the gradebook and edit the course grade feedback you had previously set
      2. Change some of the grades, from mod_assign, not the gradebook
        • Set a 100
        • Set a 0
      3. Restore the backup as "merge" in the same course
      4. Make sure there are no errors during the process
      5. If the process details were displayed, make sure you see some messages like "User id x already has a grade entry for grade item id x".
      6. Go to the gradebook, and confirm that:
        • There is a new mod_assign using the backed up grades
        • The course grade has been updated for each student
        • The course feedback you had set has not been restored to what is was at the time of the backup

      Restore new course

      1. Restore the backup using "Restore as a new course"
      2. Confirm that there were no errors
      3. Confirm that the assignment grades have been restored, and the course grades are equal to the assignment
      4. Confirm that the course feedback has been restored, and was the one set before the backup

      Restore with delete

      1. Restore the backup using "Delete the contents of this course and then restore"
      2. Confirm that there were no errors
      3. Confirm that the assignment grades have been restored, and the course grades are equal to the assignment
      4. Confirm that the course feedback has been restored, and was the one set before the backup
      Show
      Test pre-requisites Create a new course with a few students Create a new assignment activity with some submissions Grade the submissions (from mod_assign, not the gradebook - give the grades 10, 20, 30, ...) Edit the course grade for a student, and add a feedback to it Backup the course leaving the default settings (user data included) Merge restore Go to the gradebook and edit the course grade feedback you had previously set Change some of the grades, from mod_assign, not the gradebook Set a 100 Set a 0 Restore the backup as "merge" in the same course Make sure there are no errors during the process If the process details were displayed, make sure you see some messages like "User id x already has a grade entry for grade item id x". Go to the gradebook, and confirm that: There is a new mod_assign using the backed up grades The course grade has been updated for each student The course feedback you had set has not been restored to what is was at the time of the backup Restore new course Restore the backup using "Restore as a new course" Confirm that there were no errors Confirm that the assignment grades have been restored, and the course grades are equal to the assignment Confirm that the course feedback has been restored, and was the one set before the backup Restore with delete Restore the backup using "Delete the contents of this course and then restore" Confirm that there were no errors Confirm that the assignment grades have been restored, and the course grades are equal to the assignment Confirm that the course feedback has been restored, and was the one set before the backup
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-45283-master

      Description

      MDLQA-7047, MDLQA-7050, and MDLQA-7051 - each of these three tests require course contents to be restored as part of the QA test. All three work okay if you 'Delete the contents of this course and then restore.' All three tests fail if you select 'Merge the backup course into this course.' All three cause an Error writing to database and the restore fails.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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