Commit a385c197 authored by Kristof De Jaeger's avatar Kristof De Jaeger
Browse files

Issue #3311006 by Sandeep Date, swentel, Yasser Samman, robertoperuzzo,...

Issue #3311006 by Sandeep Date, swentel, Yasser Samman, robertoperuzzo, Sutharsan: TypeError: Argument 1 passed to Drupal\field_group\FormatterHelper::groupElementsContainErrors() must be of the type array, null given
parent ae14f1e2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -500,10 +500,10 @@ function field_group_field_overview_submit(array $form, FormStateInterface $form
        $group->format_settings += $manager->getDefaultSettings($group->format_type, $context);
      }

      /** @var EntityFormInterface $entity_form */
      /** @var \Drupal\Core\Entity\EntityFormInterface $entity_form */
      $entity_form = $form_state->getFormObject();

      /** @var EntityDisplayInterface $display */
      /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $display */
      $display = $entity_form->getEntity();

      field_group_group_save($group, $display);
+7 −5
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ class FormatterHelper implements TrustedCallbackInterface {
        $parents[] = $group_name;
        $element[$group_name]['#parents'] = $parents;
        $group_children_parent_group = implode('][', $parents);
        if (isset($group->children)) {
          foreach ($group->children as $child) {
            if (!empty($element[$child]['#field_group_ignore'])) {
              continue;
@@ -100,6 +101,7 @@ class FormatterHelper implements TrustedCallbackInterface {
            $element[$child]['#group'] = $group_children_parent_group;
          }
        }
      }

      foreach ($element['#fieldgroups'] as $group_name => $group) {
        $field_group_element = &$element[$group_name];
@@ -150,7 +152,7 @@ class FormatterHelper implements TrustedCallbackInterface {
        $closed = isset($element[$fieldgroup->group_name]['#open']) && !$element[$fieldgroup->group_name]['#open'];
        if ($closed) {
          foreach ($fieldgroup->children as $child) {
            if (static::groupElementsContainErrors($element[$child])) {
            if (isset($element[$child]) && static::groupElementsContainErrors($element[$child])) {
              $element[$fieldgroup->group_name]['#open'] = TRUE;
              break;
            }