Example:
the ivw_integration module overwrites the field group of the field_ivw and assigns it to the advanced section / group

if (empty($form['advanced'])) {
      $form['advanced'] = [
        '#type' => 'vertical_tabs',
        '#attributes' => ['class' => ['entity-meta']],
        '#weight' => 99,
      ];
    }
    $form['ivw_integration_settings_override'] = [
      '#type' => 'details',
      '#title' => t('IVW settings'),
      '#open' => FALSE,
      '#group' => 'advanced',
      '#optional' => TRUE,
    ];

if the field_ivw is already assigned to a field group in the content types form, the field will not be placed in the advanced group, because it gets overwritten by the field_group module.

The problem occured after upgrading from fieldgroup 1.0.0 to 8.x-3.0-rc1

Comments

shagel created an issue. See original summary.

shagel’s picture

shagel’s picture

I changed the field_group_from_process to not overwrite the group if it is already set by another module.

function field_group_form_process(array &$element, FormStateInterface $form_state = NULL, array &$form = []) {
.....
foreach ($group->children as $child) {
 if (!isset($element[$child]['#group'])) {
   $element[$child]['#group'] = $group_children_parent_group;
 }
}
......
shagel’s picture

Status: Active » Needs review
shagel’s picture

Title: Assigned fieldgroup relation gets overwitten » Assigned fieldgroup gets overwitten
shagel’s picture

Issue summary: View changes

  • zuuperman committed 1f05a00 on 8.x-3.x authored by shagel
    Issue #3086818 by shagel: Assigned fieldgroup gets overwitten
    
nils.destoop’s picture

Status: Needs review » Fixed

Thx for the patch. I committed it to dev

shagel’s picture

Issue summary: View changes
mariagwyn’s picture

This commit: https://git.drupalcode.org/project/field_group/commit/1f05a00 appears to remove the "workflow" vertical tab from the form display groups. While it appears to be weighted correctly in the admin view (/admin/structure/types/manage/NODETYPE/form-display), in the form, the workflow group is not included in the vertical tab set. Instead, it is bumped to the bottom of the form. No amount of resaving the form display changes this.

I applied each commit from where I was (ba42e00) until I found the break. It was clearly on the addition of 1f05a00. I am not skilled enough with code to find why the workflow tab in particular is the one being bumped. All other tabs groups remain the same.

Note that this is a custom node type. 'Workflow' is not assigned to other node types in vertical tabs, so I cannot easily compare.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.