Merge branch 'MDL-39876-master' of git://github.com/sammarshallou/moodle

Conflicts:
	course/lib.php
This commit is contained in:
Sam Hemelryk 2013-08-21 12:08:46 +12:00
commit 6eee89bc8f
191 changed files with 280 additions and 274 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

@ -1422,7 +1422,7 @@ class restore_course_structure_step extends restore_structure_step {
}
// Course record ready, update it
$DB->update_record('course', $data);
update_course_record($data);
course_get_format($data)->update_course_format_options($data);
@ -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);
}