Skip to content
Browse files

MDL-29022 do not require idnumber in ext courses - backport from MDL-…

…29020
  • Loading branch information...
1 parent 24654d9 commit 0864c8a59dcad2c946eb3977cacae55f9ee14c99 @skodak skodak committed Aug 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 enrol/database/lib.php
View
4 enrol/database/lib.php
@@ -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]))) {

0 comments on commit 0864c8a

Please sign in to comment.
Something went wrong with that request. Please try again.