Call to a member function settingsForm() on null in field_group_format_settings_form()

Created on 14 May 2019, almost 6 years ago
Updated 21 August 2024, 8 months ago

I have migrated some field groups from a Drupal 7 site. The layouts and the regions of the display are missing. When I try to manage the display in my Drupal 8 site with the imported field groups, I am getting the following error:

Error: Call to a member function settingsForm() on null in field_group_format_settings_form() (line 459 of modules/contrib/field_group/includes/field_ui.inc).
field_group_format_settings_form(Object, Array, Object) (Line: 134)
field_group_field_ui_display_form_alter(Array, Object) (Line: 134)
field_group_form_entity_view_display_edit_form_alter(Array, Object, 'entity_view_display_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'entity_view_display_edit_form') (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm('entity_view_display_edit_form', Array, Object) (Line: 277)
Drupal\Core\Form\FormBuilder->buildForm('entity_view_display_edit_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
...

It seems that there should be a check for whether the plugin in null in field_group_format_settings_form() and the same in field_group_format_settings_summary().

  if (!$plugin) {
    return null;
  }
  return $plugin->settingsForm($form, $form_state);
🐛 Bug report
Status

Closed: outdated

Version

3.6

Component

Code

Created by

🇬🇷Greece mariaioann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark uv516 Denmark

    The issue is back in Drupal 10.3.2:

    Call to a member function settingsForm() on null in Drupal\field_group\Form\FieldGroupAddForm->buildConfigurationForm() (line 241 of modules/contrib/field_group/src/Form/FieldGroupAddForm.php).
    In function buildConfigurationForm $form_state->getValue('group_formatter') and ->getValue('label') is wrong.
    See this:

        $plugin = $manager->getInstance([
    //      'format_type' => $form_state->getValue('group_formatter'),
          'format_type' => $form_state->getValue('add')['group_formatter'],
          'configuration' => [
    //        'label' => $form_state->getValue('label'),
            'label' => $form_state->getValue('new_group_wrapper')['label'],
          ],
          'group' => $group,
        ]);
    

    But it is not enough. A now group is not created on the form. (I have tried different group types)

Production build 0.71.5 2024