Hello,
I have a Drupal Commerce site using Commerce Checkout Redirect and Profile2.
I have a custom Profile2 profile which is not meant to appear on the default user/register page but only at its own custom path.
However, if an anonymour user adds a product to the cart and then initiates checkout, the /user/register page shows the custom Profile2 fields as well. If the user removes the product from the cart, or if I disable the Commerce Checkout Redirect module, the custom fields no longer appera at /user/register.
For the time being I am hiding the custom profile fields with css, but this approach forces me to make those custom fields optional while they should be required because the custom profile is related to a special role.
PS I believe this issue is quite recent because I never noticed in the past.
Comments
Comment #1
dave bruns commentedJust confirming that I've seen the same problem on a site I'm testing. However, one correction, the conflict is not with Profile2, but rather with Profile2 Registration Path (https://www.drupal.org/project/profile2_regpath)
The problem seems to be that Profile2 reg path relies on the form #action, i.e. in profile2_regpath_form_alter:
but commerce checkout redirect unsets $form['#action'] in commerce_checkout_redirect_form_alter:
Comment #2
kunalkursija commentedI also faced this #action issue , this was breaking profile registration page on site.
i had no time to fix this, so i uninstalled the module and fix checkout redirection by using "checkout_router" .
Comment #3
oksana-c commentedThis solution does not involve modification of Commerce Checkout Redirect module.
I was able to fix same issue in my implementation of commerce + profile2 + profile2 reg path by modifying a line in profile2_regpath.module:
Comment #4
spanners commented#3 fixed my issue. Thank you.
Comment #5
drupal-son commentedSame issue here.
When anonymous user registered using profile2 registration path, it assigned all roles instead the registration path role.
This error message is present in logs: Notice: Undefined index: #action in profile2_regpath_form_alter() (line 427 of /srv/bindings/44d5fa834e8a49ff83095483f58d6e8d/code/sites/all/modules/profile2_regpath/profile2_regpath.module).
#3 fixed the issue.
You should think on publish a patch here https://www.drupal.org/node/2502115
Thanks.