### Eclipse Workspace Patch 1.0 #P CVS Index: backup/restorelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/backup/restorelib.php,v retrieving revision 1.283.2.43 diff -u -r1.283.2.43 restorelib.php --- backup/restorelib.php 12 May 2008 23:05:33 -0000 1.283.2.43 +++ backup/restorelib.php 14 May 2008 00:22:50 -0000 @@ -7202,16 +7202,20 @@ $status = clear_backup_dir($backup_unique_code); } - //Now delete old data and directories under dataroot/temp/backup + //Now copy the zip file to dataroot/temp/backup/backup_unique_code if ($status) { + //Now delete old data and directories under dataroot/temp/backup if (!defined('RESTORE_SILENTLY')) { echo "
  • ".get_string("deletingolddata").'
  • '; } - $status = backup_delete_old_data(); - } - - //Now copy he zip file to dataroot/temp/backup/backup_unique_code - if ($status) { + if (!backup_delete_old_data()) { + if (!defined('RESTORE_SILENTLY')) { + notify("Error deleting old data"); + } else { + $errorstr = "Error deleting old data"; + //TODO - need to write something to the backup error log here! + } + } if (!defined('RESTORE_SILENTLY')) { echo "
  • ".get_string("copyingzipfile").'
  • '; } @@ -7219,7 +7223,7 @@ if (!defined('RESTORE_SILENTLY')) { notify("Error copying backup file. Invalid name or bad perms."); } else { - $errorstr = "Error copying backup file. Invalid name or bad perms"; + $errorstr = "Error copying backup file. Invalid name or bad perms"; //TODO need to write something to the backup error log here! return false; } }