Permalink
Browse files

MDL-34612 Restore: Gracefully handle empty file contenthash while res…

…toring
  • Loading branch information...
1 parent 4db1863 commit 0cb284699815dfaf8e00ea33bf8d5e85b7e1b4cd @rajeshtaneja rajeshtaneja committed Oct 15, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 backup/util/dbops/restore_dbops.class.php
@@ -908,6 +908,15 @@ public static function send_files_to_pool($basepath, $restoreid, $component, $fi
}
if (empty($file->repositoryid)) {
+ // If contenthash is empty then gracefully skip adding file.
+ if (empty($file->contenthash)) {
+ $result = new stdClass();
+ $result->code = 'file_missing_in_backup';
+ $result->message = sprintf('missing file (%s) contenthash in backup for component %s', $file->filename, $component);
+ $result->level = backup::LOG_WARNING;
+ $results[] = $result;
+ continue;
+ }
// this is a regular file, it must be present in the backup pool
$backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);

0 comments on commit 0cb2846

Please sign in to comment.