Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.288
diff -u -p -r1.288 profile.module
--- modules/profile/profile.module	12 Mar 2010 15:56:29 -0000	1.288
+++ modules/profile/profile.module	28 Mar 2010 12:21:53 -0000
@@ -273,8 +273,6 @@ function profile_save_profile(&$edit, $a
       ))
       ->fields(array('value' => $edit[$field->name]))
       ->execute();
-    // Mark field as handled (prevents saving to user->data).
-    $edit[$field->name] = NULL;
   }
 }
 
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1149
diff -u -p -r1.1149 user.module
--- modules/user/user.module	27 Mar 2010 05:52:50 -0000	1.1149
+++ modules/user/user.module	28 Mar 2010 12:21:54 -0000
@@ -239,6 +239,10 @@ class UserController extends DrupalDefau
     foreach ($queried_users as $key => $record) {
       $picture_fids[] = $record->picture;
       $queried_users[$key] = drupal_unpack($record);
+      // As well as unpacking $user->data, also convert the property to an
+      // unserialized array. This ensures we can always safely resialize it
+      // in user_save().
+      $queried_users[$key]->data = unserialize($record->data);
       $queried_users[$key]->roles = array();
       if ($record->uid) {
         $queried_users[$record->uid]->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
@@ -334,11 +338,8 @@ function user_load_by_name($name) {
  *   TRUE or omit the $account->uid field.
  * @param $edit
  *   An array of fields and values to save. For example array('name'
- *   => 'My name'). Keys that do not belong to columns in the user-related
- *   tables are added to the a serialized array in the 'data' column
- *   and will be loaded in the $user->data array by user_load().
- *   Setting a field to NULL deletes it from the data column, if you are
- *   modifying an existing user account.
+ *   => 'My name'). Key / value pairs added to the $edit['data'] will be
+ *   serialized and saved in the {users.data} column.
  * @param $category
  *   (optional) The category for storing profile information in.
  *
@@ -3391,10 +3392,7 @@ function user_register_submit($form, &$f
   }
   $notify = !empty($form_state['values']['notify']);
 
-  // The unset below is needed to prevent these form values from being saved as
-  // user data.
   form_state_values_clean($form_state);
-  unset($form_state['values']['notify']);
 
   $form_state['values']['pass'] = $pass;
   $form_state['values']['init'] = $form_state['values']['mail'];
