The standard sections edit form allows HTML Tags to be saved as the title of the section but the title is stripped of HTML tags before rendering and also the quick edit form strips the tags before saving to the db.
- Create a course with Topics Format.
- Edit one of the sections of the course and enter custom name for the title with some HTML tags.
- Hit Save
- Return to the course page
- Turn Editing On and quick edit the previously edited section.
- See the tags appearing only in edit mode.
- Hit enter
- See the tags being stripped.
This is causing a problem during a backup restore operation where the title have HTML Tags in them.
To replicate the restore error:
- Edit a topic name via the 'Edit' -> 'Edit topic'
- Check the custom box
- Wrap the name in a <div>
- Backup the course
- Try to restore the course into a new course and notice the error below.
- line 152 of /backup/util/ui/backup_ui_setting.class.php: base_setting_ui_exception thrown
- line 170 of /backup/moodle2/restore_section_task.class.php: call to base_setting_ui->set_label()
- line 153 of /backup/util/plan/base_task.class.php: call to restore_section_task->define_settings()
- line 60 of /backup/util/plan/base_plan.class.php: call to base_task->set_plan()
- line 173 of /backup/moodle2/restore_plan_builder.class.php: call to base_plan->add_task()
- line 216 of /backup/moodle2/restore_plan_builder.class.php: call to restore_plan_builder::build_section_plan()
- line 114 of /backup/moodle2/restore_plan_builder.class.php: call to restore_plan_builder::build_course_plan()
- line 74 of /backup/util/plan/restore_plan.class.php: call to restore_plan_builder::build_plan()
- line 513 of /backup/controller/restore_controller.class.php: call to restore_plan->build()
- line 143 of /backup/controller/restore_controller.class.php: call to restore_controller->load_plan()
- line 86 of /backup/restore.php: call to restore_controller->__construct()
If the tags are removed then the restore goes smoothly.