$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
}
- // Now make sure the user that is running the restore can actually access the course
- $this->add_step(new restore_fix_restorer_access_step('fix_restorer_access'));
-
// Restore course filters (conditionally)
if ($this->get_setting_value('filters')) {
$this->add_step(new restore_filters_structure_step('course_filters', 'filters.xml'));
// Conditionally create the temp table (can exist from prechecks) and delete old stuff
$this->add_step(new restore_create_and_clean_temp_stuff('create_and_clean_temp_stuff'));
+ // Now make sure the user that is running the restore can actually access the course
+ // before executing any other step (potentially performing permission checks)
+ $this->add_step(new restore_fix_restorer_access_step('fix_restorer_access'));
+
// If we haven't preloaded information, load all the included inforef records to temp_ids table
$this->add_step(new restore_load_included_inforef_records('load_inforef_records'));
// With problems of type error, throw exception, shouldn't happen if prechecks were originally
// executed, so be radical here.
if (array_key_exists('errors', $problems)) {
- throw new restore_dbops_exception('restore_problems_processing_questions', null, implode(', ', $problems));
+ throw new restore_dbops_exception('restore_problems_processing_questions', null, implode(', ', $problems['errors']));
}
}