You are here

function social_event_update_8914 in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.0.x modules/social_features/social_event/social_event.install \social_event_update_8914()
  2. 10.1.x modules/social_features/social_event/social_event.install \social_event_update_8914()
  3. 10.2.x modules/social_features/social_event/social_event.install \social_event_update_8914()

Remove un-required fieldgroup 'group_description' from event content type.

File

modules/social_features/social_event/social_event.install, line 1769
Install, update and uninstall functions for the social_event module.

Code

function social_event_update_8914() {

  // There can be possibility that someone might have added fields in
  // fieldgroups we are removing. So, we want to skip removal if there are any
  // children present in fieldgroup.
  $field_groups = [
    'group_description',
  ];
  foreach ($field_groups as $field_group) {
    $group = field_group_load_field_group($field_group, 'node', 'event', 'form', 'default');
    if ($group && empty($group->children)) {
      field_group_delete_field_group($group);
    }
  }
}