If a user has profile any fields in a category called 'account', then executing the add roles action causes them to be unset.
This is because workflow_ng_action_user_addrole() calls user_save() without setting the third argument. As a result this argument defaults to 'account', which effectively says that the update contains updates to the equivalent profile area, although it doesn't. When profile_save_profile() gets called as a side effect of the user_save() call, it extracts the profile fields from the edit argument, but as they are not present gets empty values, which it then stores in the DB.
The solution is simple: change line 210 from:
user_save($user, array('roles' => $user->roles));
to
user_save($user, array('roles' => $user->roles), null);
Comments
Comment #1
fagook, I've fixed that. thanks.