mirror of
https://github.com/moodle/moodle.git
synced 2025-01-20 23:18:43 +01:00
Now userid and groupid fields are recoded correctly
in the restore process. This should make the backup utility group-compliant !! (when talking about forums, of course) :-)
This commit is contained in:
parent
dfa14bc98f
commit
61f95aada5
@ -204,6 +204,18 @@
|
||||
$discussion->assessed = backup_todb($dis_info['#']['ASSESSED']['0']['#']);
|
||||
$discussion->timemodified = backup_todb($dis_info['#']['TIMEMODIFIED']['0']['#']);
|
||||
|
||||
//We have to recode the userid field
|
||||
$user = backup_getid($restore->backup_unique_code,"user",$discussion->userid);
|
||||
if ($user) {
|
||||
$discussion->userid = $user->new_id;
|
||||
}
|
||||
|
||||
//We have to recode the groupid field
|
||||
$group = backup_getid($restore->backup_unique_code,"group",$discussion->groupid);
|
||||
if ($group) {
|
||||
$discussion->groupid = $group->new_id;
|
||||
}
|
||||
|
||||
//The structure is equal to the db, so insert the forum_discussions
|
||||
$newid = insert_record ("forum_discussions",$discussion);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user