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.
How exactly can I put a field in a group when calling field_create_instance() ? Or is there a separate call which I need to do after field_create_instance() ?
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedThere is no way actually.
The only thing I can think of:
- fetch the fieldgroup from database (field_group_read_groups($params = array()) ) which will be the wrapper
- add the field_name to the children array of the group
- save the group again
Comment #2
swentel CreditAttribution: swentel commentedIndeed, you need to fetch the group from the database and save it again.