From 1a6c02fabacdee07a2600984f59bde54f9929862 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 10 Mar 2004 17:10:26 +0000 Subject: [PATCH] Detected 2 bugs when restoring users and scales about recoding the id field !! --- backup/restorelib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup/restorelib.php b/backup/restorelib.php index 051fc538f8..f0e19e83f2 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -575,6 +575,8 @@ //Here, if create_user, do it if ($create_user) { + //Unset the id because it's going to be inserted with a new one + unset ($user->id); //We addslashes to necessary fields $user->username = addslashes($user->username); $user->firstname = addslashes($user->firstname); @@ -762,7 +764,6 @@ //$GLOBALS['traverse_array']=""; //Debug //Now build the SCALE record structure - $sca->id = backup_todb($info['SCALE']['#']['ID']['0']['#']); $sca->courseid = backup_todb($info['SCALE']['#']['COURSEID']['0']['#']); $sca->userid = backup_todb($info['SCALE']['#']['USERID']['0']['#']); $sca->name = backup_todb($info['SCALE']['#']['NAME']['0']['#']); -- 2.39.5