From 869a91b72eaf85a447e8fd1b78aad51a8b5676cc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 16 Oct 2004 16:59:59 +0000 Subject: - Patch #11505 by Steven: 'my account' information is not saved. + Drupal 4.4 stored profile data in the serialized user->data column. Drupal 4.5 stores profile data in tables (but user->data is still available and used for other stuff, like locale or themes). The update from 4.4 to 4.5 didn't remove the old data from the user->data column properly, because there is no mechanism in user_save to do so (it did try to unset the fields, but this has no effect). + On registration, hook_user('insert') is invoked after saving the data column. This means that any module-specific data is put into the data field. We cannot move hook_user('insert') higher up, because before that point, we do not have a complete $user object yet. --- modules/profile/profile.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/profile') diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 276cefa64..3bf611a03 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -162,7 +162,8 @@ function profile_save_profile(&$edit, &$user, $category) { } db_query("DELETE FROM {profile_values} WHERE fid = %d AND uid = %d", $field->fid, $user->uid); db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", $field->fid, $user->uid, $edit[$field->name]); - unset($edit[$field->name], $user->{$field->name}); + // Mark field as handled (prevents saving to user->data). + $edit[$field->name] = null; } } -- cgit v1.2.3