mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
MDL-45068 groups: corrected check for idnumber '0'
This commit is contained in:
parent
af4fa2a55b
commit
539ad434cb
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue