Some modules, like the field group module, are expecting a call to $hook_field_attach_fields in order to act on the form.
The following patch adds in some gyrations that invokes field_attach_fields by faking the bundle and entity type for the multifield, and sets it back when done. Not sure if there is a cleaner way, but this patch allows me to use field groups with multifields.
I now have vertical tabs, that contain multifields that are themselves subdived into two vertical tabs, and I can have 1-N of them. Im really rather pleased with this situation.
Comments
Comment #1
dave reidLooks like I had intended to call field_attach_form(). Let's try this alternative which fits what I've been doing with the existing field_attach_* cloned and altered functions.
Comment #2
MixologicWhen I create a field group on a multifield, it stores the bundle and entity name that the fieldgroups are assigned to, in this case is the machine name of the multifield and 'multifield'.
So, in order to get field groups to load up the proper field group information, we'll have to uncomment this $bundle line.
But since we're passing in the $element by reference to _multifield_field_attach_form(), that would change it in the calling function, and we still want the bundle in that context to reflect the bundle that the multifield is attached to. So I still think we need to stash the bundle, change it to the multifield machine name, call hook_field_attach_form, and then restore it.
Comment #3
dave reidOk here's a revised version that reverts the internal properties back. I've tested this with Field Group and it appears to be working correctly.
Comment #4
dave reidTry that again.
Comment #5
dave reidCommitted #4 to 7.x-1.x.
Comment #9
dave reidComment #11
mcdoolz commentedI seem to be encountering this. Latest dev version of multifield, and field_group isn't affecting upon it at all.