Download & Extend

Multiple calls to field_attach_form() causes conflicts

Project:Conditional Fields
Version:7.x-3.x-dev
Component:Compatibility w/ other modules
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:Patch to allow multiple duplicate conditional fields

Issue Summary

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.

Comments

#1

Status:needs work» needs review

Here is the patch

AttachmentSize
conditional_fields-multiple_calls_to_field_attach_form_causes_conflicts-1803568-1.patch 22.28 KB

#2

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).

AttachmentSize
conditional_fields-multiple_calls_to_field_attach_form_causes_conflicts-1803568-2.patch 23.38 KB