I am exporting users from another platform and I want the user id in the drupal installation to be the same as the user id in the other platform. Is there anyway user create can be modified to put in the id I tell it to ?

Comments

marcingy’s picture

Category: feature » support
dianacastillo’s picture

I need to modify the user_save function in user.module to read like this :

if (empty($account->uid)) {
	     // if we have a designated id, put that one in.
        if ($uww_uid){
		  $account->uid =$uww_uid; 
	}else{
		   $account->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
	 }  
  }

How can I do this outside of the core instead? thanks

marcingy’s picture

Status: Active » Closed (won't fix)

Too many browser windows :( Removed comment and set back status

marcingy’s picture

dianacastillo’s picture

Status: Closed (fixed) » Active

I made a module which works with services with xml-rpc and allows you to assign id you wish to user register via xml-rpc you must send the field uww_uid in the xml . I implemented hook_form_alter and hook_user_presave . I have attached it here https://drupal.org/node/1851154#comment-6796536

dianacastillo’s picture

Status: Closed (won't fix) » Closed (fixed)

Status: Active » Closed (fixed)