Hello, I am using the profile.module to set some profile fields. How can the module get the value of the profile field for the current user. I am sure it was in $user->data (which we had to unserialize), but it doesn't seem to be the case anymore. I am working with HEAD but I did a quick test with 4.7 and I have the same problem. Now, when I do print_r($user), I don't see any value corresponding to my profile field, not even in $user->data? Where is it supposed to be? thanks, Augustin. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
On Sunday 08 October 2006 07:54 pm, Augustin (Beginner) wrote:
I am sure it was in $user->data (which we had to unserialize), but it doesn't seem to be the case anymore.
Apparently, I have to use user_load() even for the current user. the reason I picked it up in $user->data earlier may be because the profile data is inside just after submitting the profile form. It works now. augustin. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
On 10/8/06, Augustin (Beginner) <drupal.beginner@wechange.org> wrote:
On Sunday 08 October 2006 07:54 pm, Augustin (Beginner) wrote:
I am sure it was in $user->data (which we had to unserialize), but it doesn't seem to be the case anymore.
Apparently, I have to use user_load() even for the current user. the reason I picked it up in $user->data earlier may be because the profile data is inside just after submitting the profile form.
It works now.
Good to hear that you got it working - just to offer some more advice. The profile_csv module shows ways to get at the data more directly than user_load. It has a patch to work with the hidden fields: http://drupal.org/node/83310 "Hidden" profile information is stored in serialized form in users.data field. The real trick comes if you have a field that is public and then you change it to hidden: the data will then be split between records created and not edited BEFORE the change to hidden, which will be in the profile_* tables and the data created or edited AFTER the change which will now be in the users.data field. So, the safest/easiest thing is probably to use user_load as you found. Regards, Greg -- Greg Knaddison | Growing Venture Solutions Denver, CO | http://growingventuresolutions.com Technology Solutions for Communities, Individuals, and Small Businesses
On Monday 09 October 2006 12:08 am, Greg Knaddison - GVS wrote:
"Hidden" profile information is stored in serialized form in users.data field. The real trick comes if you have a field that is public and then you change it to hidden: the data will then be split between records created and not edited BEFORE the change to hidden, which will be in the profile_* tables and the data created or edited AFTER the change which will now be in the users.data field.
Thanks Greg for the feedback. This is a distinction I needed to know. Now, I know what to be careful about when using profile fields. Blessings, Augustin. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
participants (2)
-
Augustin (Beginner) -
Greg Knaddison - GVS