Skip to content

Commit

Permalink
Merge branch 'wip-MDL-43021-m25' of git://github.com/marinaglancy/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_25_STABLE
  • Loading branch information
Damyon Wiese committed Apr 7, 2014
2 parents 19fd2cb + 68f41b2 commit 547f695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions course/lib.php
Expand Up @@ -2377,14 +2377,14 @@ function update_course($data, $editoroptions = NULL) {

// Check we don't have a duplicate shortname.
if (!empty($data->shortname) && $oldcourse->shortname != $data->shortname) {
if ($DB->record_exists('course', array('shortname' => $data->shortname))) {
if ($DB->record_exists_sql('SELECT id from {course} WHERE shortname = ? AND id <> ?', array($data->shortname, $data->id))) {
throw new moodle_exception('shortnametaken', '', '', $data->shortname);
}
}

// Check we don't have a duplicate idnumber.
if (!empty($data->idnumber) && $oldcourse->idnumber != $data->idnumber) {
if ($DB->record_exists('course', array('idnumber' => $data->idnumber))) {
if ($DB->record_exists_sql('SELECT id from {course} WHERE idnumber = ? AND id <> ?', array($data->idnumber, $data->id))) {
throw new moodle_exception('idnumbertaken', 'error');
}
}
Expand Down

0 comments on commit 547f695

Please sign in to comment.