mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-34612 Restore: Gracefully handle empty file contenthash while restoring
This commit is contained in:
parent
62b6135c38
commit
0daadaaeaf
1 changed files with 9 additions and 0 deletions
|
@ -976,6 +976,15 @@ abstract class restore_dbops {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($file->repositoryid)) {
|
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
|
// 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);
|
$backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue