Over in #1161314: Add basic Field Group support for ANDing conditions, we have a patch that adds initial support for field_group. However, it calls field_group_info_groups() to get a list of field_group elements, and thus has to be wrapped in module_exists(). We'd like to refactor that to make it a hook that could be implemented in field_group, since that'd be much more maintainable.
Similarly, in that same issue, we're working on allowing conditional_fields settings for a field_group element to apply instead to the fields that it contains. It may be worthwhile to introduce another hook at that point to delegate how to determine which fields are contained within a group field. Again, the idea is just to keep the implementation-specific logic where it belongs.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | field_group-support_conditional_fields-3099051-6.patch | 993 bytes | ergonlogic |
Comments
Comment #2
ergonlogicPatches will be forthcoming, as the hooks are introduced in
conditional_fields.Comment #3
ergonlogichook_conditional_fields()was introduced in this patch in #1161314: Add basic Field Group support for ANDing conditions. The patch here implements that hook, to make Conditional Fields aware of Field Group elements.Comment #4
ergonlogicThe attached patch adds an implementation of
hook_conditional_fields_children(), introduced in this patch from #1161314: Add basic Field Group support for ANDing conditions. This allows Conditional Fields to propagate its settings from the Field Group to the fields that it contains.Comment #5
ergonlogicMinor update to handle calls to the implementation of
hook_conditional_fields_children()where the field being queried isn't a field group.Comment #6
ergonlogicI updated how
hook_conditional_fields_children()gets called to keep internal logic/state from leaking.Comment #7
kris77 commentedThis look fine for me.
Thanks a lot @ergonlogic, your patch works fine.
Comment #8
colan@Kris77: Care to RTBC this then?
Comment #9
kris77 commentedComment #10
liliplanet commentedOmg, that is fabulous, thank you for the dedication that went into this, world perfectly 😁
Comment #12
nils.destoop commentedThx for the patch. I committed it to dev