]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fix for MDL-8803 from 1.8
authormoodler <moodler>
Fri, 9 Mar 2007 05:04:53 +0000 (05:04 +0000)
committermoodler <moodler>
Fri, 9 Mar 2007 05:04:53 +0000 (05:04 +0000)
lib/db/upgrade.php

index 6e6e78292dc518bbb261c57c1603ced17ddf51cb..8b03dcdc4af9a05cfc77fc426566b70f375fae86 100644 (file)
@@ -339,8 +339,7 @@ function xmldb_main_upgrade($oldversion=0) {
         $index->setFields(array('username'));
         drop_index($table, $index);
         $index->setFields(array('mnethostid', 'username'));
-        $empty_on_duplicate = add_index($table, $index);
-        if(empty($fail_on_duplicate)) {
+        if (!add_index($table, $index)) {
             notify(get_string('duplicate_usernames', 'mnet', 'http://docs.moodle.org/en/DuplicateUsernames'));
         }