mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Part fix of bug MDL-10332 "Data module not filtering list by group on .." - restore bug.
This commit is contained in:
parent
714ee0b618
commit
11d97de1b2
@ -220,6 +220,7 @@ function data_records_restore_mods ($old_data_id, $new_data_id, $info, $restore)
|
||||
$rec_info = $records[$i];
|
||||
$oldid = backup_todb($rec_info['#']['ID']['0']['#']);
|
||||
|
||||
$record = new object();
|
||||
$record -> dataid = $new_data_id;
|
||||
$record -> userid = backup_todb($rec_info['#']['USERID']['0']['#']);
|
||||
$record -> groupid = backup_todb($rec_info['#']['GROUPID']['0']['#']);
|
||||
@ -227,10 +228,14 @@ function data_records_restore_mods ($old_data_id, $new_data_id, $info, $restore)
|
||||
$record -> timemodified = backup_todb($rec_info['#']['TIMEMODIFIED']['0']['#']);
|
||||
$record -> approved = backup_todb($rec_info['#']['APPROVED']['0']['#']);
|
||||
$user = backup_getid($restore->backup_unique_code,"user",$record->userid);
|
||||
$group= backup_getid($restore->backup_unique_code,"groups",$record->groupid);
|
||||
|
||||
if ($user) {
|
||||
$record->userid = $user->new_id;
|
||||
}
|
||||
if ($group) {
|
||||
$record->groupid= $group->new_id;
|
||||
}
|
||||
|
||||
$newid = insert_record ("data_records",$record);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user