If I call user_save() directly, will it invoke content profile action

newbuntu - March 24, 2009 - 08:02
Project:Content Profile
Version:6.x-1.x-dev
Component:Base module
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm trying to by pass the new user form. I collected my own data, then invoked user_save() like:

<?php
>
  
$arr = array();
  
$arr['name'] = $uname;
  
$arr['mail'] = $mail;
  
$arr['pass'] = $pass;
  
  
$arr['field_per_first_name'][0]['value'] = $fname;
  
$arr['field_per_last_name'][0]['value'] = $lname;
  
$arr['field_per_phone_number'][0]['value'] = $phone;
  
  
$arr['type'] = 'person_profile';
  
$arr['status'] = true;
  
  
$new_user = user_save('', $arr);
?>

The user was created. I was hoping it would create the person_profile (content profile type) for me too, but it didn't. Now I'm stuck.

Any help is greatly appreciated! Thx!

#1

avior - September 3, 2009 - 22:45

did you manage to do that ?

#2

NancyDru - March 9, 2010 - 22:28

I haven't specifically look at Content Profile, but based on my experience the last few days with core Profile, I'm going to guess that this doesn't work. I have to launch my site, so I can't find out for sure for a few days, but what it looks like I will have to do is the user_save without the updates, then a second user_save with the returned user object and the updates array.

 
 

Drupal is a registered trademark of Dries Buytaert.