Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
jhodgdonOK, 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.
Comment #2
jhodgdonAs 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.
Comment #3
bfroehle CreditAttribution: bfroehle commentedWell, this behavior is unique to profile. You could certainly update just the user name by doing user_save($account, array('name' => 'newname'));.
Comment #4
jhodgdonbfroehle: 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?