Skip to content

Commit

Permalink
MDL-45068 groups: corrected check for idnumber '0'
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 29, 2017
1 parent 108411a commit 60770d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions group/import.php
Expand Up @@ -134,7 +134,7 @@
}
}

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))) {
Expand All @@ -144,7 +144,7 @@
$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))) {
Expand Down

0 comments on commit 60770d1

Please sign in to comment.