-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.11.11, 4.0.5, 4.1
-
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');
- duplicates
-
MDL-74698 Course backups from versions earlier than 3.11.7 lose format options on restore
- Closed