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

Restoring backups from 1.9 does not set grade_categories.depth

XMLWordPrintable

    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      1. Restore the attached backup-moodle2-course-g100-20120126-1012-19export.mbz

      2. Go to the gradebook, edit categories page, and verify that the grade category has move and delete icons.

      3. Verify in the database that the grade_category is present, and that the depth and path fields are correct.

      Show
      1. Restore the attached backup-moodle2-course-g100-20120126-1012-19export.mbz 2. Go to the gradebook, edit categories page, and verify that the grade category has move and delete icons. 3. Verify in the database that the grade_category is present, and that the depth and path fields are correct.

      Moodle 1.9 did not write grade_categories.depth and grade_categories.path to the backup file because both of these can be re-constructed from grade_categories.parent.

      This is not totally a problem, because 2.x restore code computes grade_categories.path from parent on lines 375 - 400 of backup/moodle2/restore_stepslib.php

      However, it does not re-compute depth at the same time. It relies on the correct value being in the backup file which was not the case for a custom "Convert courses from 1.9 -> 2.x" system we developed at the OU>

      As a results, you get grade_categories in the DB with depth = 0.

      Surprisingly, this does not break very much. We only noticed it at the OU because the move icon is only shown on categories where depth > 0, and someone noticed that they could not move any categories in their course that came from 1.9.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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