i'm currently editing the profile.module of 4.5.2, so that it allows creating profile fields to belong to specific user roles, so that in affect the users have different profiles.

i've already done most things, but i've a problem with the hook_user. i need the $user object in profile_categories, but unfortunately it seems that $user isn't set for the hook with type categories. (in detail i need $user->roles, i also tried to access $user->uid, but no success..)

it's quite strange, because the other types can access $user. (of course i changed the function calls accordingly)
i'm new to drupal, so i don't know if this is the intended behaviour of hook_user. if so, from where can i get the information, whos profile is currently edited, else?

Comments

fago’s picture

i had to change user.module to set the variable. quite confusing, that the arguments aren't set always..

however if anyone is interested in my work, you can find a patch here:
http://zites.net/devel/drupal/
it's not tested much ;)

edit: i added a new field, which offers creating radio buttons.