Hi guys, first I thank you for your time and for reading this, I appreciate it a lot.

I'm still new in Drupal, so I used a lot css files to modify my website. But, I have to change the content of some forms for specific registers.

I'm using modules :
profile2
profile2 registration path (allows me to have multiple forms, one for each role of my users)

I've made some hook_alter_form to edit the content displayed during registration, and here is the result on my website :
http://hpics.li/ab921eb

What I want to do is to modify the description of the field_logo (for example), but I can't find the right element to modify cause I'm not geting every element when i check the $form thanks to my hook.

(I can't print you here the test page because the forum won't let me do)

I have modified the mail and username without any problems but I can't find the other fields. How could I get to them, any ideas ?

Thanks a lot for your time guys, I really appreciate it. I stay at your disposal if you need any information.

Comments

patrickkearney’s picture

Hello,
I strongly suggest installing the devel module, then you can put the following in your code:
dpm($form);
and it will show ALL of the fields, as well as how each one's array is keyed/structured. This tool has saved me countless hours in learning about forms in drupal.

Hope that helps,

Patrick

Angelysto’s picture

Sorry for the late answer ! dpm($form) is already what i used. Even without dpm I simply write it down this way :

    print '<pre>';
    print_r($form);
    print '</pre>';

But I think Jaypan just got the right solution.

Jaypan’s picture

It's likely the profile2 module is being run after your module, so the profile2 fields are not available to your module. You can set your module's hook file to run later than the profile2 module by implementing hook_module_implements_alter().

Angelysto’s picture

Thanks for your time and for your answer Jaypan, it works this way I didn't think about the run order !

Wow it appears quite obvious now than you've said it. You nailed it thanks.

wasimhyder09’s picture

Thanks a lot man.
It saved a lot of headache for me.
P.S: Jaypan, You are the best.

Jaypan’s picture

:)