Skip to content

Commit

Permalink
Part fix of bug MDL-10332 "Data module not filtering list by group on…
Browse files Browse the repository at this point in the history
… .." - restore bug. Merged.
  • Loading branch information
nfreear committed Jul 12, 2007
1 parent eceb647 commit be76a35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/data/restorelib.php
Expand Up @@ -220,17 +220,22 @@ 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']['#']);
$record -> timecreated = backup_todb($rec_info['#']['TIMECREATED']['0']['#']);
$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);

Expand Down

0 comments on commit be76a35

Please sign in to comment.