Skip to content
Browse files

Merged from MOODLE_14_STABLE: Adding fix for idnumber duplication pro…

…blem in restoring from backup discussed at http://moodle.org/mod/forum/discuss.php?d=16297
  • Loading branch information...
1 parent 0eb3582 commit 68ba62d21adc23547b0e3ac5049b2a26b7218e77 mjollnir_ committed Dec 17, 2004
Showing with 8 additions and 0 deletions.
  1. +4 −0 backup/restore_execute.html
  2. +1 −0 backup/restorelib.php
  3. +3 −0 lang/en/moodle.php
View
4 backup/restore_execute.html
@@ -64,6 +64,7 @@
//Saving conversion id variables into backup_tables
if ($restore->restoreto == 2) {
echo "<li>".get_string("creatingnewcourse");
+ $oldidnumber = $course_header->course_idnumber;
if (!$status = restore_create_new_course($restore,$course_header)) {
notify("Error while creating the new empty course.");
}
@@ -72,6 +73,9 @@
echo "<ul>";
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")";
echo "<li>".get_string("category").": ".$course_header->category->name;
+ if (!empty($oldidnumber)) {
+ echo "<li>".get_string("nomoreidnumber","moodle",$oldidnumber)."</li>";
+ }
echo "</ul>";
//Put the destination course_id
$restore->course_id = $course_header->course_id;
View
1 backup/restorelib.php
@@ -527,6 +527,7 @@ function restore_create_new_course($restore,&$course_header) {
$course->fullname = addslashes($course_header->course_fullname);
$course->shortname = addslashes($course_header->course_shortname);
$course->idnumber = addslashes($course_header->course_idnumber);
+ $course->idnumber = ''; //addslashes($course_header->course_idnumber); // we don't want this at all.
$course->summary = restore_decode_absolute_links(addslashes($course_header->course_summary));
$course->format = addslashes($course_header->course_format);
$course->showgrades = addslashes($course_header->course_showgrades);
View
3 lang/en/moodle.php
@@ -654,6 +654,8 @@
$string['loginusing'] = 'Login here using your username and password';
$string['logout'] = 'Logout';
$string['logs'] = 'Logs';
+$string['logtoomanycourses'] = ' [ <a href=\"$a->url\">more</a> ] ';
+$string['logtoomanyusers'] = ' [ <a href=\"$a->url\">more</a> ] ';
$string['mailadmins'] = 'Inform admins';
$string['mailstudents'] = 'Inform students';
$string['mailteachers'] = 'Inform teachers';
@@ -768,6 +770,7 @@
$string['nograde'] = 'No grade';
$string['noimagesyet'] = 'No images have been uploaded to your course yet';
$string['nomorecourses'] = 'No more matching courses could be found';
+$string['nomoreidnumber'] = 'Not using an idnumber to avoid collisions';
$string['none'] = 'None';
$string['nopotentialadmins'] = 'No potential admins';
$string['nopotentialcreators'] = 'No potential course creators';

0 comments on commit 68ba62d

Please sign in to comment.
Something went wrong with that request. Please try again.