From bd99632d76c6a28f5c167451b4891dc36795aa90 Sat, 13 Aug 2011 12:48:50 +0200
From: Jorrit Schippers <jorrit@ncode.nl>
Date: Sat, 13 Aug 2011 11:47:43 +0200
Subject: [PATCH] Remove references to updating the user.data field

diff --git a/supported/profile.inc b/supported/profile.inc
index 2ca98c0..fb00410 100644
--- a/supported/profile.inc
+++ b/supported/profile.inc
@@ -34,22 +34,16 @@
 
   // get all fields
   $profile_fields = profile_get_fields();
-  $data = $old_data = unserialize($account->data);
 
   foreach ($profile_fields as $field) {
-    profile_user_import_save_profile($field, $account->uid, $fields['profile'][$field->fid][0], $updated, $update_setting_per_module['profile'], $data);
+    profile_user_import_save_profile($field, $account->uid, $fields['profile'][$field->fid][0], $updated, $update_setting_per_module['profile']);
   }
-  
-  // data column in the user table needs to be updated
-  if ($data != $old_data) {   
-    db_query("UPDATE {users} SET data = '%s' WHERE uid = %d LIMIT 1", serialize($data), $account->uid);
-  } 
 
   return;
 }
 
 
-function profile_user_import_save_profile($field, $uid, $value, $updated, $update_setting, &$data) {   
+function profile_user_import_save_profile($field, $uid, $value, $updated, $update_setting) {   
 
   // when the profile field is displayed on the registration form an empty value is automatically saved by the Profile module
   $exists = db_result(db_query("SELECT value FROM {profile_values} WHERE fid = %d AND uid = %d LIMIT 1", $field->fid, $uid));
@@ -68,7 +62,6 @@
         if (empty($value) && $update_setting == UPDATE_REPLACE) {
           
           db_query("DELETE FROM {profile_values} WHERE fid = %d AND uid = %d", $field->fid, $uid);
-          unset($data[$field->name]);
           return;
         }
 
@@ -79,8 +72,7 @@
         else {
           db_query("UPDATE {profile_values} SET value = '%s' WHERE fid = %d AND uid = %d LIMIT 1", $value, $field->fid, $uid);  
         }
-        
-        $data[$field->name] = $value; 
+         
         return;
     } 
 
@@ -94,7 +86,6 @@
     }
     else {  
      db_query("UPDATE {profile_values} SET value = '%s' WHERE fid = %d AND uid = %d LIMIT 1", $value, $field->fid, $uid);
-      $data[$field->name] = $value;
     }
   }
 

