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

Restoring a course doesn't restore course format options correctly, when course option names match section option names

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.11.11, 4.0.5, 4.1
    • Backup
    • None
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE

      Where a course format has course option names that match section option names, settings are not restored correctly from a course backup.  This seems to have been caused by MDL-65478.

      This looks like it may be related to MDL-74698.

      Testing Instructions
      1. Requires a Moodle test server with Multitopic format installed.
      2. Log in.
      3. Add a new course in Multitopic format with Topic duration set to 1 day.
      4. Add a topic, and set Topic duration override to 1 week.
      5. Backup course.
      6. Restore backup as a new course.
      7. Verify the course setting Period duration is set to 1 day.

      To Fix
      In backup/moodle2/restore_stepslib.php function process_course_format_option()
      Change:
              $record = $DB->get_record('course_format_options', [ 'courseid' => $courseid, 'name' => $data['name'] ], 'id');

      To:
              $record = $DB->get_record('course_format_options', [ 'courseid' => $courseid, 'name' => $data['name'], 'sectionid' => $data['sectionid'] ], 'id');

            Unassigned Unassigned
            james-cnz James E. Calder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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