MDL-39876 Change get_record('course') calls to get_course

This commit is contained in:
sam marshall 2013-06-18 17:00:37 +01:00
parent 838d78a9ff
commit ab7632b74c
189 changed files with 231 additions and 233 deletions

View file

@ -148,7 +148,7 @@ class backup_section_task extends backup_task {
// All these are common settings to be shared by all sections
$section = $DB->get_record('course_sections', array('id' => $this->sectionid), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $section->course), '*', MUST_EXIST);
$course = get_course($section->course);
// Define section_included (to decide if the whole task must be really executed)
$settingname = $settingprefix . 'included';

View file

@ -1632,7 +1632,7 @@ class restore_default_enrolments_step extends restore_execution_step {
public function define_execution() {
global $DB;
$course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
$course = get_course($this->get_courseid());
if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
// Something already added instances, do not add default instances.
@ -1849,7 +1849,7 @@ class restore_fix_restorer_access_step extends restore_execution_step {
return;
}
if (!$DB->record_exists('enrol', array('enrol'=>'manual', 'courseid'=>$courseid))) {
$course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST);
$course = get_course($courseid);
$fields = array('status'=>ENROL_INSTANCE_ENABLED, 'enrolperiod'=>$enrol->get_config('enrolperiod', 0), 'roleid'=>$enrol->get_config('roleid', 0));
$enrol->add_instance($course, $fields);
}