Hi,

in field_group_remove_empty_display_groups() you reset empty groups by setting them NULL:

  // Reset an empty group.
  if ($empty_group) {
    $element = NULL;
  }

This crashes the foreach loop in field_group_field_group_build_pre_render_alter().

One solution could be resetting empty group elements by setting them as empty array:

  // Reset an empty group.
  if ($empty_group) {
    $element = [];
  }

Another solution could be adding an if condition around the foreach loop and check if the $element is an array.

Best regards
Michael

Comments

michaelpetri created an issue. See original summary.

michaelpetri’s picture

Status: Active » Closed (duplicate)
Related issues: +#2713995: Fatal error when no value in field

Duplicated and already fixed in dev branch. Sorry.