API page: http://api.drupal.org/api/drupal/modules--user--user.module/function/use...

Describe the problem you have found:
The documentation on the edit suggests that you can simply pass a field name and data value into the user_save function. If you do this on a profile field it will remove the data for the rest of the fields in that category. As you can see from my comment on the d7 version and the commends on the d6 version, this is not new functionality.

Comments

jhodgdon’s picture

Title: Documentation problem with user_save » user_save should document that $edit is saved as the entire data array

OK, we should document this behavior. If you want, you can file a code issue against Drupal 8 (user.module component) and ask for the behavior to be changed as well.

jhodgdon’s picture

As a note: the behavior to be documented is that whatever you pass for $edit is saved as the *entire* list of profile fields, so you need to include all of them (such as by calling user_load() I think) to avoid blanking them out.

bfroehle’s picture

Well, this behavior is unique to profile. You could certainly update just the user name by doing user_save($account, array('name' => 'newname'));.

jhodgdon’s picture

bfroehle: Yes, it's unique to profile.module (does that still exist in D7?).

Actually, it sounds like if you made the call you suggested and were using the Profile module, it would get rid of all the profile fields. Is that correct?