I have a profile2 Profile that's named Driver. This profile has a Term reference to a vocabulary named Cities that contains over 30.000 terms.
I made a custom user-register.tpl.php by declaring it in my template.php, and in here I display only the form keys that interests me for the account creation.
When I go to driver/register which is the custom page for registering to my profile type, the loading is taking too much time, and I suspect it to be caused by the loading of all the fields of my profile (even those non-rendered) and more especially that vast vocabulary.
I looked into profile2 folders and files trying to comment parts related to the registration but nothing would prevent the loading from happening.
I also tried to unset($form[profile_driver]) in my theme_form_user_register_alter, but it doesn't affect the fact that the profile fields are still loaded before being removed from $form, so I figured it has to be directly in profile2.
Been struggling for quite some days now so if anyone has clues on how to prevent the loading of the whole profile form or ideally specific fields I would be glad to read how to do the trick !
Thanks
7.x-1.4
FINAL EDIT :
I didn't manage to do it programmatically so I ended up setting up a Rule that assigns the Profile & the role to the newly saved user.