Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-27856 Fix incorrect instanceid assignment.

  • Loading branch information...
commit 9549090df0ed0a651f38af41759cfc9f22ef6fd0 1 parent b01c955
@stronk7 stronk7 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 enrol/cohort/lib.php
View
4 enrol/cohort/lib.php
@@ -243,7 +243,7 @@ public function restore_instance(restore_enrolments_structure_step $step, stdCla
if ($data->roleid and $DB->record_exists('cohort', array('id'=>$data->customint1))) {
$instance = $DB->get_record('enrol', array('roleid'=>$data->roleid, 'customint1'=>$data->customint1, 'courseid'=>$course->id, 'enrol'=>$this->get_name()));
if ($instance) {
- $instanceid = $instance;
+ $instanceid = $instance->id;
} else {
$instanceid = $this->add_instance($course, (array)$data);
}
@@ -257,7 +257,7 @@ public function restore_instance(restore_enrolments_structure_step $step, stdCla
$instance = $DB->get_record('enrol', array('roleid'=>$data->roleid, 'customint1'=>$data->customint1, 'courseid'=>$course->id, 'enrol'=>$this->get_name()));
if ($instance) {
- $instanceid = $instance;
+ $instanceid = $instance->id;
} else {
$data->status = ENROL_INSTANCE_DISABLED;
$instanceid = $this->add_instance($course, (array)$data);
Please sign in to comment.
Something went wrong with that request. Please try again.