By bboe on
We've installed Drupal 5 on our server, enabled the profile module and added a couple of fields for each user to set when registering. For some reason, some field values are stored in 'profile_fields/profile_values' tables, and some users has their fields stored in serialized form in users.data table column. Can anyone please explain why it happens, and whether I need to deserialize the data from users.data field? We use MySql stored procedures to work with the Drupal database and deserializing users data takes very long time because of a great number of users.
Thanks,
Jon
Comments
Re: users.data and profile_fields/profile_values tables
Here's the link to the dev. thread http://lists.drupal.org/archives/development/2006-11/msg00431.html where guys discuss the necessity for users.data and its behavior.
In short you shouldn't rely on data from this column, because in the next versions of Drupal it may cease existing (and for a number of other reasons as well).
---------------------------------------
Exelica Spreadsheet Reporting
-= www.exelica.com =-
Hard defect here
I observe exactly the same in one installation here, and it actually shows a defect.
If you create an account on http://winhlp.com/, open the user list, and click on female, you get a list of all female users. However, the list shows only the few users where the gender is stored in the profile_fields/profile_values tables. It misses all the others, where the gender is stored in users.data.
This may have to do something with this field having changed from showing up in the user form only to showing up in the user list.
To me the defect looks as if the place where the profile field value is stored, when the user enters it, depends on the visibility settings of the field at the time.
Any idea how I can repair the database and deserialize these fields into the profile_fields/profile_values tables, short of going through each user by hand?
Hans-Georg
Addendum: Found http://drupal.org/node/119114, containing attachment: profile.module_28.patch (978 bytes)
I installed the patch here. Very unfortunately it is not retroactive, so I had to go through some contortions to go into edit mode and resave the personal data for each user. Extremely awkward, if you have many users. I also don't know yet whether it works. Will see soon and have no choice, so no need for extra testing at this time.
Check also http://drupal.org/node/133993 for a potential problem.
Hans-Georg
2007-08-01 Addendum:
Appears to be fixed in Drupal 5.2. If anybody can confirm or deny this, please reply.
Hans-Georg