You are here

function inline_entity_form_form_alter in Inline Entity Form 8

Same name and namespace in other branches
  1. 7 inline_entity_form.module \inline_entity_form_form_alter()

Implements hook_form_alter().

File

./inline_entity_form.module, line 42
Provides a widget for inline management (creation, modification, removal) of referenced entities. The primary use case is the parent -> children one (for example, order -> line items), where the child entities are never managed outside the…

Code

function inline_entity_form_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  // Attach the IEF handlers only if the current form has an IEF widget.
  $widget_state = $form_state
    ->get('inline_entity_form');
  if (!is_null($widget_state)) {
    ElementSubmit::attach($form, $form_state);
    WidgetSubmit::attach($form, $form_state);
  }
}