Skip to content

Commit

Permalink
MDL-34837 backup: Restore does not fail when some courses have the sa…
Browse files Browse the repository at this point in the history
…me name
  • Loading branch information
polothy authored and Frederic Massart committed Oct 15, 2012
1 parent 6738413 commit 6e76324
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backup/util/dbops/restore_dbops.class.php
Expand Up @@ -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);
Expand Down

0 comments on commit 6e76324

Please sign in to comment.