The module adds field_group_build_entity_groups() as a preprocess function to entity render arrays in the hook_theme_registry_alter() implementation. Thus, the field_group's hook_field_group_build_pre_render_alter() implementation can receive an entity render array as $element and it is passed directly to field_group_remove_empty_display_groups(), which in some edge cases can replace the received render array with a NULL.

Having NULL instead of an entity render array causes the whole entity to not be rendered, since the next preprocess hook will get NULL instead of a render array and this makes the whole page crash with a fatal error.

There would be a couple solutions to this, but, I think the most elegant one is to pass in the $group_name to nested calls, and only use the $empty_group flag to empty the $elements array when there is a $group_name present.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SchnWalter created an issue. See original summary.

SchnWalter’s picture

SchnWalter’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 20161104--field_group--fix_entity_render-2824838-2.patch, failed testing.

SchnWalter’s picture

Ups, wrong patch.

SchnWalter’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: field_group--fix_entity_render-2824838-2.patch, failed testing.

Pete B’s picture

Status: Needs work » Closed (cannot reproduce)

Please add some steps to reproduce the issue.