diff --git a/backuplib.php b/backuplib.php index a5c1545..0c36cc7 100644 --- a/backuplib.php +++ b/backuplib.php @@ -108,6 +108,7 @@ //Print contents fwrite ($bf,full_tag('ID',6,false,$item->id)); fwrite ($bf,full_tag('COURSEID',6,false,$item->courseid)); + fwrite ($bf,full_tag('GROUPID',6,false,$item->groupid)); fwrite ($bf,full_tag('SESSDATE',6,false,$item->sessdate)); fwrite ($bf,full_tag('DURATION',6,false,$item->duration)); fwrite ($bf,full_tag('TIMEMODIFIED',6,false,$item->timemodified)); diff --git a/restorelib.php b/restorelib.php index 79a22c1..26320ad 100644 --- a/restorelib.php +++ b/restorelib.php @@ -67,6 +67,11 @@ //Now, build the attforblock_SESSIONS record structure $stat->courseid = $restore->course_id; + $stat->groupid = backup_todb($stat_info['#']['GROUPID']['0']['#']); + $group = restore_group_getid($restore, $stat->groupid); + if ($group) { + $stat->groupid = $group->new_id; + } // $stat->creator = backup_todb($stat_info['#']['CREATOR']['0']['#']); $stat->sessdate = backup_todb($stat_info['#']['SESSDATE']['0']['#']); $stat->timemodified = backup_todb($stat_info['#']['TIMEMODIFIED']['0']['#']);