If you call field_attach_form for a form with conditional fields more than once, the duplicate conditional fields are not processed. I have modified the module to account for all instances of a conditional field in the form and process each field. This is for compatibility with Commerce Registration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arosboro’s picture

Status: Needs work » Needs review
Issue tags: +Patch to allow multiple duplicate conditional fields
FileSize
22.28 KB

Here is the patch

mrconnerton’s picture

Here is a new patch against the latest dev. I too am using this for commerce_registration support.

I did have to make a tweak in the conditional_fields_evaluate_dependencies function around 1009 to support the "unique ids" which I'm fairly sure are entity ids. I could also be completely wrong and its just bad semantics.

I have also noticed that I cannot edit a registration at /registration/#/edit:

Recoverable fatal error: Argument 2 passed to drupal_array_get_nested_value() must be an array, null given, called in /sites/all/modules/contrib/conditional_fields/conditional_fields.module on line 461 and defined in drupal_array_get_nested_value() (line 6521 of /includes/common.inc).

SocialNicheGuru’s picture

Issue summary: View changes
Status: Needs review » Needs work
pipep’s picture

This patch solved it for me after updating.