It seems hook_field_group_build_pre_render_alter() is never called since 3.x (8.x-3.0-rc1 or 8.x-3.0-rc3)

I found that code in 3.x in field_group_build_entity_groups() :

// Allow others to alter the pre_rendered build.
Drupal::moduleHandler()->alter('field_group_build_pre_render', $element);

Maybe it has been replaced by field_group_form_process_build ?

Comments

pguillard created an issue. See original summary.

gbirch’s picture

For anyone who hits this issue, I'm not sure that this is a bug so much as a documentation problem.

The API is different from the Drupal 7 version. If you want to mess with field groups on forms, you want hook_field_group_form_process() (to alter individual field groups) or hook_field_group_form_process_build() (to alter any of the available field groups).

The description and sample code in hook_field_group_build_pre_render_alter() in field_group.api.php is pretty clearly wrong and should be conformed to the implementation in field_group_field_group_build_pre_render_alter().

  • nils.destoop committed bcb6da5 on 8.x-3.x
    Issue #3100893: hook_field_group_build_pre_render_alter() is not called...
nils.destoop’s picture

Status: Active » Fixed

The hook_field_group_build_pre_render_alter is still used, but only in the entity view context. It idd used to work also with forms, but the form handling was moved to the processing part.

I modified the api example.

nils.destoop’s picture

gbirch’s picture

Thanks for fixing it!

pguillard’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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