Permalink
Browse files

Part fix of bug MDL-10332 "Data module not filtering list by group on…

… .." - restore bug. Merged.
  • Loading branch information...
1 parent 253f9ee commit 8c21e87a7be3986d26d65fb32facf99b86f8231f nfreear committed Jul 12, 2007
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/data/restorelib.php
View
@@ -220,18 +220,23 @@ 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);
//Do some output

0 comments on commit 8c21e87

Please sign in to comment.