]> git.mjollnir.org Git - moodle.git/commitdiff
Detected 2 bugs when restoring users and scales about
authorstronk7 <stronk7>
Wed, 10 Mar 2004 17:10:26 +0000 (17:10 +0000)
committerstronk7 <stronk7>
Wed, 10 Mar 2004 17:10:26 +0000 (17:10 +0000)
recoding the id field !!

backup/restorelib.php

index 051fc538f8efc9b6f4aa41d697c539f972697434..f0e19e83f229609ca7808e3dbcd9dc2606519b07 100644 (file)
 
                 //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);
                         //$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']['#']);