mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
backup MDL-22254 Implemented course completion skip criteria for module criteria that cannot be restored. Cheers Eloy for spotting.
This commit is contained in:
parent
03dd057556
commit
aa54831894
@ -1317,17 +1317,21 @@ class restore_course_completion_structure_step extends restore_structure_step {
|
||||
$data->role = $this->get_mappingid('role', $data->role);
|
||||
}
|
||||
|
||||
$skipcriteria = false;
|
||||
|
||||
// If the completion criteria is for a module we need to map the module instance
|
||||
// to the new module id.
|
||||
if (!empty($data->moduleinstance) && !empty($data->module)) {
|
||||
$data->moduleinstance = $this->get_mappingid('course_module', $data->moduleinstance);
|
||||
if (empty($data->moduleinstance)) {
|
||||
$skipcriteria = true;
|
||||
}
|
||||
} else {
|
||||
$data->module = null;
|
||||
$data->moduleinstance = null;
|
||||
}
|
||||
|
||||
// We backup the course shortname rather than the ID so that we can match back to the course
|
||||
$skipcriteria = false;
|
||||
if (!empty($data->courseinstanceshortname)) {
|
||||
$courseinstanceid = $DB->get_field('course', 'id', array('shortname'=>$data->courseinstanceshortname));
|
||||
if (!$courseinstanceid) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user