function workspaces_form_alter

Same name and namespace in other branches
  1. 10 core/modules/workspaces/workspaces.module \workspaces_form_alter()
  2. 9 core/modules/workspaces/workspaces.module \workspaces_form_alter()

Implements hook_form_alter().

File

core/modules/workspaces/workspaces.module, line 59

Code

function workspaces_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form_state->getFormObject() instanceof EntityFormInterface) {
    \Drupal::service('class_resolver')->getInstanceFromDefinition(EntityOperations::class)
      ->entityFormAlter($form, $form_state, $form_id);
  }
  \Drupal::service('class_resolver')->getInstanceFromDefinition(FormOperations::class)
    ->formAlter($form, $form_state, $form_id);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.