Permalink
Browse files

MDL-34837 backup: Restore does not fail when some courses have the sa…

…me name
  • Loading branch information...
1 parent f4b03cf commit e4ce1be4b582e933fb9c5680bd26707af731f1bc @mrmark mrmark committed with FMCorz Oct 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 backup/util/dbops/restore_dbops.class.php
View
3 backup/util/dbops/restore_dbops.class.php
@@ -1302,7 +1302,8 @@ public static function calculate_course_names($courseid, $fullname, $shortname)
}
$currentfullname = $fullname.$suffixfull;
$currentshortname = substr($shortname, 0, 100 - strlen($suffixshort)).$suffixshort; // < 100cc
- $coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?', array($currentfullname, $courseid));
+ $coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?',
+ array($currentfullname, $courseid), '*', IGNORE_MULTIPLE);
$courseshort = $DB->get_record_select('course', 'shortname = ? AND id != ?', array($currentshortname, $courseid));
$counter++;
} while ($coursefull || $courseshort);

0 comments on commit e4ce1be

Please sign in to comment.