Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By NaSPA1 on
Hi all! I'm having a problem with custom profile fields created in Drupal 4.5.0. Its a snap to create the fields, they show up wonderfully in the edit user UI... But for some reason they do not seem to get loaded into the $user object when the user logs in. I'm assuming they are supposed to show up as part of the $user object, but if they appear elsewhere that's fine too - I just need to know where my modules can find them.
Thanks!
Radi Shourbaji
http://radi-shourbaji.profconnect.org
Comments
Workaround -- call profile_load_profile yourself
'm not sure how to catagorize this either, but as far as I can tell, profile_load_profile gets called only via profile_user; in other words, if the hook_user isn't called, and user_load is called directly, you will get only the data in the user table.
I'd guess that calling user_load is *not* the right way to get a valid user object, although blog.module does indeed do this. But I have yet to find any other way of doing this documented.
The work-around is to call profile_load_profile yourself, which will get you the custom data.
Rob Thorne
Torenware Networks
Just what I'm looking for...
This is just what I'm looking for can you explain exactly how to do this? (some sample code)
Thanks
Here is a sample
See comment in http://drupal.org/node/22908#comment-39277.
It contains a short sample.