Permalink
Browse files

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

…me name
  • Loading branch information...
1 parent 6738413 commit 6e763244ed799bb4eb4fc4f049429f9b99b90f86 @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
@@ -1505,7 +1505,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 6e76324

Please sign in to comment.