Hello,

I am using the Conditional Fields module with the Entity Registration module and Drupal Commerce. I have some dependencies setup so if you choose for instance "Are you a member district" a list of Member Districts to choose from show up. So that's working great.

The problem is that a user can register for more than one event, so after they have added the two events to their cart and go to check out, they need to fill in the registration forms for both. It seems that Conditional Fields only works with the first registration form, but since there are two forms on the same page, the dependency has no affect on the other form. (See Screenshot). This can become a huge issue because it is possible that users will be registering for multiple courses, events, workshops, etc. on this site so we want to make it as clean as possible.

The screenshot shows an example of the conditional field working on the left, and not on the right.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Oliver Huynh’s picture

Category: support » bug
Status: Active » Needs review
FileSize
1.33 KB

I got this bug also. Check out attached patch to fix the issue.

peterpoe’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed, thanks!

peterpoe’s picture

Status: Fixed » Needs work

Had to revert this change, since it breaks checkboxes and radio buttons as dependees. You can use the custom jQuery selector option to adjust to your needs.

  • peterpoe committed 7bbb6db on 8.x-1.x
    Issue #1957884 by TravisJohnston: Fix same fields in  multiple forms.
    
  • peterpoe committed 23eac31 on 8.x-1.x
    Revert Issue #1957884: Conditional Fields with multiple forms (using id...
Hitby’s picture

Sorry to seem dense! I'm having the same issue with multiple fields over a registration form. Could you advise how to use the custom jQuery selector option?

Cheers!

JordanMagnuson’s picture

Status: Needs work » Closed (duplicate)

Duplicate of https://www.drupal.org/node/2530770

See proposed patch in that issue thread.

mchampsee’s picture

mchampsee’s picture

Just noticed something...

I was getting an error that read

 Notice: Undefined index: #id in drupal_process_states() (line 4807 of /code/includes/common.inc).

which is within the drupal_process_states function which gets called by drupal_render when I had a conditional field being used in a multiple field. I put a dsm($elements) at that spot and found that I got an array with 3 items in it. Other fields using states which are working in multiple forms as well as conditional fields in a regular form have over 20 items. It looks like somewhere that array is getting truncated.