MDL-34837 backup: Restore does not fail when some courses have the same name
This commit is contained in:
committed by
Frederic Massart
parent
61bfc2c13b
commit
ac1f907e77
@@ -1504,7 +1504,8 @@ abstract class restore_dbops {
|
||||
}
|
||||
$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);
|
||||
|
||||
Reference in New Issue
Block a user