mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Bug #5535 - Database module backup error in 1.5.4, patch submitted by Patrick Pollet ; merged from MOODLE_16_STABLE
This commit is contained in:
parent
ba5d423b21
commit
3cdd4eeba0
@ -44,7 +44,14 @@ function data_backup_mods($bf,$preferences) {
|
||||
// iterate
|
||||
if ($datas = get_records('data','course',$preferences->backup_course,"id")) {
|
||||
foreach ($datas as $data) {
|
||||
if (backup_mod_selected($preferences,'data',$data->id)) {
|
||||
if (function_exists('backup_mod_selected')) {
|
||||
// Moodle 1.6
|
||||
$backup_mod_selected = backup_mod_selected($preferences, 'data', $data->id);
|
||||
} else {
|
||||
// Moodle 1.5
|
||||
$backup_mod_selected = true;
|
||||
}
|
||||
if ($backup_mod_selected) {
|
||||
$status = data_backup_one_mod($bf,$preferences,$data);
|
||||
// backup files happens in backup_one_mod now too.
|
||||
}
|
||||
|
@ -90,7 +90,14 @@ function data_restore_mods($mod,$restore) {
|
||||
backup_putid($restore->backup_unique_code,$mod->modtype,
|
||||
$mod->id, $newid);
|
||||
//Now check if want to restore user data and do it.
|
||||
if (restore_userdata_selected($restore,'data',$mod->id)) {
|
||||
if (function_exists('restore_userdata_selected')) {
|
||||
// Moodle 1.6
|
||||
$restore_userdata_selected = restore_userdata_selected($restore, 'data', $mod->id);
|
||||
} else {
|
||||
// Moodle 1.5
|
||||
$restore_userdata_selected = $restore->mods['data']->userinfo;
|
||||
}
|
||||
if ($restore_userdata_selected) {
|
||||
//Restore data_fields first!!! need to hold an array of [oldid]=>newid due to double dependencies
|
||||
$status = data_fields_restore_mods ($mod->id, $newid, $info, $restore);
|
||||
$status = data_records_restore_mods ($mod->id, $newid, $info, $restore);
|
||||
|
Loading…
x
Reference in New Issue
Block a user