Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a module that takes my entity's fields and adds them to it's own form using `hook_field_attach_form()`.
Can anyone shed some light on whether or not it would be possible to support `hook_field_attach_form()` for field dependencies?
I gave it a shot, and was able to hide fields, but not show them with behaviors.
The modules I'm attempting to use with this are registration and commerce_registration.
Comment | File | Size | Author |
---|---|---|---|
#1 | conditional_fields-support_for_markup_field-1786232-1.patch | 634 bytes | arosboro |
Comments
Comment #1
arosboro CreditAttribution: arosboro commentedI did some debugging and discovered that the issue stems from the entity and bundle information being located at delta 0 of the field rather than in the field root level.
This patch allows markup fields to be evaluated using the entity and bundle information provided at delta 0 of the field.
See #1787046: Setting #field_parents for the conditional fields module for a patch to set the correct value for #field_parents in the field if using Commerce Registration.
Comment #2
arosboro CreditAttribution: arosboro commentedPatch complete. Setting status to "needs review";
Comment #3
arosboro CreditAttribution: arosboro commentedChanging component to "Compatibility w/ other modules" since this applies to the Markup module
Comment #4
jason.fisher CreditAttribution: jason.fisher commentedThis patch along with the patch from comment #42 http://drupal.org/files/conditional_fields_fixed_multiple_field_collecti... at http://drupal.org/node/1464950 has allowed conditional fields to work with Commerce Registration and Field Collections here.
Comment #5
akalata CreditAttribution: akalata commented#1 works for me, thanks!
Comment #5.0
akalata CreditAttribution: akalata commentedUpdated issue summary.
Comment #6
markabur CreditAttribution: markabur commented#1 works for me too, to show/hide Markup fields.
Comment #7
kyoder CreditAttribution: kyoder commentedWorked for me and patch applied cleanly against 7.x-3.0-alpha1+12-dev.
Comment #8
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedWhen I apply this patch, field_collections are no longer effected by a dependee.
Comment #9
kyoder CreditAttribution: kyoder commentedField collection doesn't work with conditional fields with or without this patch.
The issue queue has several field collection related posts such as this one https://www.drupal.org/project/conditional_fields/issues/1464950