From 11d97de1b2b19c4a799f856c4b464bf4f7eab88d Mon Sep 17 00:00:00 2001 From: nfreear Date: Thu, 12 Jul 2007 14:12:35 +0000 Subject: [PATCH] Part fix of bug MDL-10332 "Data module not filtering list by group on .." - restore bug. --- mod/data/restorelib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/data/restorelib.php b/mod/data/restorelib.php index aad90cc3912..60789b15248 100644 --- a/mod/data/restorelib.php +++ b/mod/data/restorelib.php @@ -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);