diff --git a/core/modules/workflows/src/Form/WorkflowTransitionEditForm.php b/core/modules/workflows/src/Form/WorkflowTransitionEditForm.php index ecc4a81..6aa7cff 100644 --- a/core/modules/workflows/src/Form/WorkflowTransitionEditForm.php +++ b/core/modules/workflows/src/Form/WorkflowTransitionEditForm.php @@ -136,15 +136,20 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form, // Only do something once form validation is complete. return; } - /** @var \Drupal\workflows\WorkflowInterface $entity */ - $values = $form_state->getValues(); - $form_state->set('created_transition', FALSE); - $entity->setTransitionLabel($values['id'], $values['label']); - $entity->setTransitionFromStates($values['id'], array_filter($values['from'])); - if (isset($values['type_settings'])) { - $configuration = $entity->getTypePlugin()->getConfiguration(); - $configuration['transitions'][$values['id']] = $values['type_settings'][$entity->getTypePlugin()->getPluginId()]; - $entity->set('type_settings', $configuration); + try { + /** @var \Drupal\workflows\WorkflowInterface $entity */ + $values = $form_state->getValues(); + $form_state->set('created_transition', FALSE); + $entity->setTransitionLabel($values['id'], $values['label']); + $entity->setTransitionFromStates($values['id'], array_filter($values['from'])); + if (isset($values['type_settings'])) { + $configuration = $entity->getTypePlugin()->getConfiguration(); + $configuration['transitions'][$values['id']] = $values['type_settings'][$entity->getTypePlugin()->getPluginId()]; + $entity->set('type_settings', $configuration); + } + } + catch(\Exception $e) { + // Do nothing, if there is an exception we want validation to handle it. } }