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

Restoring backups from 1.9 does not set grade_categories.depth

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2.1
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Backup, Gradebook
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  timhunt Tim Hunt
                  Reporter:
                  timhunt Tim Hunt
                  Integrator:
                  Eloy Lafuente (stronk7)
                  Tester:
                  Adrian Greeve
                  Participants:
                  Component watchers:
                  Damyon Wiese, Zig Tan, Ankit Agarwal, David Monllaó
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Mar/12