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

Restoring a course backup without the 'General' section and with user data leads to duplicate entries in grade_grades

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.1.5
    • Gradebook
    • None
    • MOODLE_21_STABLE

      Noticed whilst confirming the fix for MDL-31589:

      As an administrator:

      • Create a new graded item. I confirmed with both an Online Text assignment, and Lesson
        As a student
      • Submit an attempt at said graded item such that a gradebook entry is now present in mdl_grade_grades

      As administrator:

      • Backup the course:
        • Include User Data
        • Do not include the 'General' section, but do include the section with the activity in question
      • Restore the backup:
        • Go through all steps, merging in to the existing course

      What you see:
      Bang from duplicate userid, itemid index on grade_grades

      It looks like backup/moodle2/restore_stepslib.php restore_gradebook_structure_step::process_grade_grade always tries an insert, even though process_grade_item may update an existing record

      Not sure whether we should update the existing grade_grade record or ignore the newest data?

            andyjdavis Andrew Davis
            dobedobedoh Andrew Lyons
            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.