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:
stronk7 2004-01-25 21:00:06 +00:00
parent dfa14bc98f
commit 61f95aada5

View File

@ -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);