Skip to content

Commit

Permalink
MDL-29022 do not require idnumber in ext courses - backport from MDL-…
Browse files Browse the repository at this point in the history
…29020
  • Loading branch information
skodak committed Aug 20, 2011
1 parent 24654d9 commit 0864c8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enrol/database/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ public function sync_courses() {
// already exists
continue;
}
if ($idnumber and $DB->record_exists('course', array('idnumber'=>$fields[$idnumber]))) {
// idnumber duplicates are not allowed
// allow empty idnumber but not duplicates
if ($idnumber and $fields[$idnumber] !== '' and $fields[$idnumber] !== null and $DB->record_exists('course', array('idnumber'=>$fields[$idnumber]))) {
continue;
}
if ($category and !$DB->record_exists('course_categories', array('id'=>$fields[$category]))) {
Expand Down

0 comments on commit 0864c8a

Please sign in to comment.