2

I have a Main Profile page that I added to the User Registration page but I only need one option from the entire Main Profile to display while the user is creating an account. I was able to hide all of them using 'display: none' in the CSS but this caused an issue with a particular field in the Main Profile where they could list themselves as 'Featured'.

In my Custom Module I have a form_alter function but when I print out the form in tags it only shows the form values of the actual registration part. It doesn't include any fields from the Main Profile. In the developer tools on Chrome it shows that the Main Profile section is in the same form as the registration section.

Is there any way I can get to the Main Profile elements to do an unset on my particular field within my form_alter function?

Thanks

0

Main profile fields are added through hook_form_alter. Solution: hook_form_alter function is executed in all modules while accessing registration form. Your custom module form_alter is executing before Profile fields get added. To solve this issue increase custom module weight. FYI : Module weight change

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.