-
Bug
-
Resolution: Fixed
-
Critical
-
2.0, 2.1, 2.2
-
MySQL
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
wip-mdl-25432
-
If I go into a course and go to course administration -> backup I get the following error.
error/activity_task_coursemodule_not_found
More information about this error
Stack trace:
- line 104 of /backup/util/factories/backup_factory.class.php: backup_task_exception thrown
- line 120 of /backup/moodle2/backup_plan_builder.class.php: call to backup_factory::get_backup_activity_task()
- line 144 of /backup/moodle2/backup_plan_builder.class.php: call to backup_plan_builder::build_activity_plan()
- line 165 of /backup/moodle2/backup_plan_builder.class.php: call to backup_plan_builder::build_section_plan()
- line 89 of /backup/moodle2/backup_plan_builder.class.php: call to backup_plan_builder::build_course_plan()
- line 163 of /backup/util/factories/backup_factory.class.php: call to backup_plan_builder::build_plan()
- line 61 of /backup/util/plan/backup_plan.class.php: call to backup_factory::build_plan()
- line 333 of /backup/controller/backup_controller.class.php: call to backup_plan->build()
- line 126 of /backup/controller/backup_controller.class.php: call to backup_controller->load_plan()
- line 82 of /backup/backup.php: call to backup_controller->__construct()
The query that is failing to get a row is in get_coursemodule_from_id():
SELECT cm.*, m.name, md.name AS modname
FROM mdl_course_modules cm
JOIN mdl_modules md ON md.id = cm.module
JOIN mdl_forum m ON m.id = cm.instance
WHERE cm.id = 1119 AND md.name = 'forum'
I rewrote the query to find out that cm.instance == 247 but there is no forum with that ID. There are higher IDs indicating that the forum did exist but was deleted. Petr has suggested this may be caused by double clicking the link to add a forum.
Im now not able to backup my course. Ideally we'd prevent this occurring in the first place but at a minimum we need to be able to recover from this once it occurs.