/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // @todo Remove require fields for drafts. This would require JS too. parent::submitForm($form, $form_state); $eform_type = $this->entity->getEFormType(); if ($eform_type->preview_page) { $this->setMode($this::MODE_PREVIEW); } }