mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'wip-MDL-45068-master-fix' of https://github.com/marinaglancy/moodle
This commit is contained in:
commit
1577c5ea20
@ -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))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user