Index: account_profile.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/account_profile/account_profile.module,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 account_profile.module
--- account_profile.module	22 Dec 2010 09:45:19 -0000	1.1.2.12
+++ account_profile.module	14 Jan 2011 00:11:01 -0000
@@ -57,14 +57,14 @@
     break;
     case $profile . '_node_form':
       /* integration with account form */
-      if (is_numeric(arg(1)) && $user = user_load(arg(1))) { // activate only on edit page (not on registration page) 
+      if (is_numeric(arg(1)) && $user = user_load(arg(1))) { // activate only on edit page (not on registration page)
 
           module_load_include('pages.inc', 'user');
 
           $form['account_profile_uid'] = array(
             '#type' => 'value',
             '#value' => $user->uid,
-          ); 
+          );
 
           $account_form = user_profile_form(array(), $user);
           unset($account_form['submit'], $account_form['delete']); // remove duplicated Save button and Delete
@@ -129,7 +129,22 @@
   $category = $form_state['values']['_category'];
   unset($form_state['values']['_account'], $form_state['values']['op'], $form_state['values']['submit'], $form_state['values']['delete'], $form_state['values']['form_token'], $form_state['values']['form_id'], $form_state['values']['_category']);
   user_module_invoke('submit', $form_state['values'], $account, $category);
+
+  // prevent to store all values in user->data field, and give it back, before node_form_submit
+  $cache = $form_state['values'];
+  foreach ($account as $key => $value) {
+    if (isset($value)) {
+      $account_keys[] = $key;
+    }
+  }
+  foreach ($form_state['values'] as $key => $value) {
+    if (!in_array($key, $account_keys)) {
+      unset ($form_state['values'][$key]);
+
+    }
+  }
   user_save($account, $form_state['values'], $category);
+  $form_state['values'] = $cache;
 
   // Clear the page cache because pages can contain usernames and/or profile information:
   cache_clear_all();
