mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-39876 Change get_record('course') calls to get_course
This commit is contained in:
parent
838d78a9ff
commit
ab7632b74c
189 changed files with 231 additions and 233 deletions
|
@ -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';
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue