mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 14:35:29 +02:00
MDL-33430 Include repository type in files.xml in MBZ backup file
This is a valuable information needed especially when restoring the MBZ at another site. The repositoryid itself is not enough there to identify the type of the repository.
This commit is contained in:
parent
6feae1d256
commit
79b810fdc0
@ -1404,7 +1404,8 @@ class backup_final_files_structure_step extends backup_structure_step {
|
||||
'contenthash', 'contextid', 'component', 'filearea', 'itemid',
|
||||
'filepath', 'filename', 'userid', 'filesize',
|
||||
'mimetype', 'status', 'timecreated', 'timemodified',
|
||||
'source', 'author', 'license', 'sortorder', 'reference', 'repositoryid'));
|
||||
'source', 'author', 'license', 'sortorder',
|
||||
'repositorytype', 'repositoryid', 'reference'));
|
||||
|
||||
// Build the tree
|
||||
|
||||
@ -1412,12 +1413,12 @@ class backup_final_files_structure_step extends backup_structure_step {
|
||||
|
||||
// Define sources
|
||||
|
||||
$file->set_source_sql("SELECT f.*, r.repositoryid, r.reference
|
||||
$file->set_source_sql("SELECT f.*, r.type AS repositorytype, fr.repositoryid, fr.reference
|
||||
FROM {files} f
|
||||
LEFT JOIN {files_reference} r
|
||||
ON r.id = f.referencefileid
|
||||
JOIN {backup_ids_temp} bi
|
||||
ON f.id = bi.itemid
|
||||
LEFT JOIN {files_reference} fr ON fr.id = f.referencefileid
|
||||
LEFT JOIN {repository_instances} ri ON ri.id = fr.repositoryid
|
||||
LEFT JOIN {repository} r ON r.id = ri.typeid
|
||||
JOIN {backup_ids_temp} bi ON f.id = bi.itemid
|
||||
WHERE bi.backupid = ?
|
||||
AND bi.itemname = 'filefinal'", array(backup::VAR_BACKUPID));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user