Change record status: 
Project: 
Introduced in branch: 
8.7.x
Introduced in version: 
8.7.0
Description: 

Drupal 8.7.0-alpha1 introduced a new hook invoked by the Layour Builder module: hook_layout_builder_overrides_entity_form_display_alter

In Drupal 8.7.0-beta1, this hook has been removed in favor of the pre-existing and more generic hook_entity_form_display_alter hook.

Code sample before:

function MODULE_NAME_layout_builder_overrides_entity_form_display_alter(EntityFormDisplayInterface $display) {
  $display->setComponent('moderation_state', [
    'type' => 'moderation_state_default',
    'weight' => -900,
    'settings' => [],
  ]);
}

Code sample after:

function MODULE_NAME_entity_form_display_alter(EntityFormDisplayInterface $form_display, array $context) {
  if ($context['form_mode'] === 'layout_builder') {
    $form_display->setComponent('moderation_state', [
      'type' => 'moderation_state_default',
      'weight' => -900,
      'settings' => [],
    ]);
  }
}
Impacts: 
Module developers