You are here

public function AutosaveEntityFormHandler::formAlter in Lightning Workflow 8.3

Performs the needed alterations to the entity form.

Parameters

array $form: The entity form to be altered to provide the autosave functionality.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides AutosaveEntityFormHandler::formAlter

File

src/AutosaveEntityFormHandler.php, line 22

Class

AutosaveEntityFormHandler
Disables autosave in the Layout Builder interface.

Namespace

Drupal\lightning_workflow

Code

public function formAlter(array &$form, FormStateInterface $form_state) {
  $form_object = $form_state
    ->getFormObject();
  if ($form_object instanceof EntityFormInterface && $form_object
    ->getOperation() === 'layout_builder') {
    return;
  }
  else {
    parent::formAlter($form, $form_state);
  }
}