mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-37761 Backup: Do not include files in backups when importing courses/activities
When we import courses or duplicate activities, the deduplicating nature of the file_storage system means that we don't actually have to include the real files in the backup - just their metadata from the file table. The restoration process needs to know not to expect files from the backup phase so a flag is set in moodle_backup metadata.
This commit is contained in:
parent
f1454424b5
commit
b1850c12c1
8 changed files with 168 additions and 46 deletions
|
@ -61,6 +61,11 @@ class backup_file_manager {
|
|||
public static function copy_file_moodle2backup($backupid, $filerecorid) {
|
||||
global $DB;
|
||||
|
||||
if (!backup_controller_dbops::backup_includes_files($backupid)) {
|
||||
// Only include the files if required by the controller.
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalise param
|
||||
if (!is_object($filerecorid)) {
|
||||
$filerecorid = $DB->get_record('files', array('id' => $filerecorid));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue