From ae5f8de6203cb29b0733ccd7b56590b190dc7d0f Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 22 Aug 2003 13:20:06 +0000 Subject: [PATCH] Added some more error messages when restoring --- backup/restore_execute.html | 50 +++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/backup/restore_execute.html b/backup/restore_execute.html index b38ac87221..a47141de73 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -60,7 +60,9 @@ //Saving conversion id variables into backup_tables if ($restore->restoreto == 2) { echo "
  • ".get_string("creatingnewcourse"); - $status = restore_create_new_course($restore,$course_header); + if (!$status = restore_create_new_course($restore,$course_header)) { + notify("Error while creating the new empty course."); + } //Print course fullname and shortname and category if ($status) { echo ""; } else { - //Something is wrong. There is no users !! + notify("Something is wrong - no users were found!"); $status = false; } } @@ -187,13 +197,17 @@ //Now create categories and questions as needed (STEP1) if ($status and ($restore->mods[quiz]->restore)) { echo "
  • ".get_string("creatingcategoriesandquestions")."
    "; - $status = restore_create_questions($restore,$xml_file); + if (!$status = restore_create_questions($restore,$xml_file)) { + notify("Could not restore categories and questions!"); + } } //Now create user_files as needed if ($status and ($restore->user_files)) { echo "
  • ".get_string("copyinguserfiles")."
    "; - $status = restore_user_files($restore); + if (!$status = restore_user_files($restore)) { + notify("Could not restore user files!"); + } //If all is ok (and we have a counter) if ($status and ($status !== true)) { //Inform about user dirs created from backup @@ -206,7 +220,9 @@ //Now create course files as needed if ($status and ($restore->course_files)) { echo "
  • ".get_string("copyingcoursefiles")."
    "; - $status = restore_course_files($restore); + if (!$status = restore_course_files($restore)) { + notify("Could not restore course files!"); + } //If all is ok (and we have a counter) if ($status and ($status !== true)) { //Inform about user dirs created from backup @@ -219,13 +235,17 @@ //Now create scales as needed if ($status) { echo "
  • ".get_string("creatingscales"); - $status = restore_create_scales($restore,$xml_file); + if (!$status = restore_create_scales($restore,$xml_file)) { + notify("Could not restore custom scales!"); + } } //Now create course modules as needed if ($status) { echo "
  • ".get_string("creatingcoursemodules"); - $status = restore_create_modules($restore,$xml_file); + if (!$status = restore_create_modules($restore,$xml_file)) { + notify("Could not restore custom scales!"); + } } //Now create log entries as needed @@ -236,7 +256,9 @@ //Now, if all is OK, adjust the instance field in course_modules !! if ($status) { echo "
  • ".get_string("checkinginstances"); - $status = restore_check_instances($restore); + if (!$status = restore_check_instances($restore)) { + notify("Could not adjust instances in course_modules!"); + } } //Now if all is OK, update: @@ -254,7 +276,9 @@ //Cleanup temps (files and db) if ($status) { echo "
  • ".get_string("cleaningtempdata"); - $status = clean_temp_data ($restore); + if (!$status = clean_temp_data ($restore)) { + notify("Could not clean up temporary data from files and database"); + } } //End the main ul @@ -266,7 +290,7 @@ echo ""; if (!$status) { - error ("An error has ocurred"); + error ("An error has occurred and the restore could not be completed!"); } //Print final message -- 2.39.5