Commit 1577c5ea authored by jun's avatar jun
Browse files

Merge branch 'wip-MDL-45068-master-fix' of https://github.com/marinaglancy/moodle

parents a0de91e9 b955ad6a
......@@ -134,7 +134,7 @@ if ($mform_post->is_cancelled()) {
}
}
if (!empty($newgroup->idnumber)) {
if (isset($newgroup->idnumber) && strlen($newgroup->idnumber)) {
//if idnumber is set, we use that.
//unset invalid courseid
if (!$mycourse = $DB->get_record('course', array('idnumber'=>$newgroup->idnumber))) {
......@@ -144,7 +144,7 @@ if ($mform_post->is_cancelled()) {
$newgroup->courseid = $mycourse->id;
}
} else if (!empty($newgroup->coursename)) {
} else if (isset($newgroup->coursename) && strlen($newgroup->coursename)) {
//else use course short name to look up
//unset invalid coursename (if no id)
if (!$mycourse = $DB->get_record('course', array('shortname' => $newgroup->coursename))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment