Permalink
Browse files

field data should be backed up/restored regardless of whether user da…

…ta is selected
  • Loading branch information...
1 parent 89edf6b commit bc63c4bac3f95372fc92ef93817b5d4806c9ca7b moodler committed Nov 10, 2006
Showing with 6 additions and 4 deletions.
  1. +3 −1 mod/data/backuplib.php
  2. +3 −3 mod/data/restorelib.php
View
@@ -103,13 +103,15 @@ function data_backup_one_mod($bf,$preferences,$data) {
// if we've selected to backup users info, then call any other functions we need
// including backing up individual files
+
+ $status = backup_data_fields($bf,$preferences,$data->id);
+
if (backup_userdata_selected($preferences,'data',$data->id)) {
//$status = backup_someuserdata_for_this_instance();
//$status = backup_somefiles_for_this_instance();
// ... etc
$status = backup_data_records($bf,$preferences,$data->id);
- $status = backup_data_fields($bf,$preferences,$data->id);
if ($status) {
$status = backup_data_files_instance($bf,$preferences,$data->id); //recursive copy
}
View
@@ -98,10 +98,10 @@ function data_restore_mods($mod,$restore) {
// Moodle 1.5
$restore_userdata_selected = $restore->mods['data']->userinfo;
}
+ //Restore data_fields first!!! need to hold an array of [oldid]=>newid due to double dependencies
+ $status = $status and data_fields_restore_mods ($mod->id, $newid, $info, $restore);
if ($restore_userdata_selected) {
- //Restore data_fields first!!! need to hold an array of [oldid]=>newid due to double dependencies
- $status = $status and data_fields_restore_mods ($mod->id, $newid, $info, $restore);
- $status = $status and data_records_restore_mods ($mod->id, $newid, $info, $restore);
+ $status = $status and data_records_restore_mods ($mod->id, $newid, $info, $restore);
}
} else {

0 comments on commit bc63c4b

Please sign in to comment.