diff --git a/modules/recurring_events_registration/recurring_events_registration.module b/modules/recurring_events_registration/recurring_events_registration.module index 147f7b012d0ab0a09f41f301c8b67ac0b66313b2..e5959ad625bafb27185560c9b9df72294de82dfc 100644 --- a/modules/recurring_events_registration/recurring_events_registration.module +++ b/modules/recurring_events_registration/recurring_events_registration.module @@ -476,7 +476,7 @@ function recurring_events_registration_form_alter(array &$form, FormStateInterfa if ($form_object instanceof RegistrantForm) { /** @var \Drupal\recurring_events_registration\Entity\RegistrantInterface $entity */ $entity = $form_object->getEntity(); - if (!empty($entity) && $entity instanceof RegistrantInterface && $entity->getEntityTypeId() === 'registrant') { + if (!empty($entity) && $entity instanceof RegistrantInterface && $entity->getEntityTypeId() === 'registrant' && !empty($form['actions'])) { foreach ($form['actions']['submit']['#submit'] as $key => $submit) { if (is_array($submit) && $submit[0] === 'Drupal\content_moderation\EntityTypeInfo') { unset($form['actions']['submit']['#submit'][$key]); diff --git a/modules/recurring_events_registration/src/Form/RegistrantForm.php b/modules/recurring_events_registration/src/Form/RegistrantForm.php index 84b00a50cd86daf94168823a6ef14251375cd053..2a777c48965990f91b84d1bfb4a64c69e7970533 100644 --- a/modules/recurring_events_registration/src/Form/RegistrantForm.php +++ b/modules/recurring_events_registration/src/Form/RegistrantForm.php @@ -190,7 +190,7 @@ class RegistrantForm extends ContentEntityForm { $editing = !$entity->isNew(); if (empty($event_instance)) { - throw new NotFoundHttpException(); + return; } // Use the registration creation service to grab relevant data.