diff --git a/modules/civiremote_event/src/Controller/RegisterFormController.php b/modules/civiremote_event/src/Controller/RegisterFormController.php index 563d613..11d06f2 100644 --- a/modules/civiremote_event/src/Controller/RegisterFormController.php +++ b/modules/civiremote_event/src/Controller/RegisterFormController.php @@ -159,13 +159,13 @@ public function title(stdClass $event) { private function getFormId($profile = NULL, string $context = 'create') { // Use generic form ID. switch ($context) { - case 'create': + case self::CONTEXT_CREATE: $form_id = '\Drupal\civiremote_event\Form\RegisterForm'; break; - case 'update': + case self::CONTEXT_UPDATE: $form_id = '\Drupal\civiremote_event\Form\RegistrationUpdateForm'; break; - case 'cancel': + case self::CONTEXT_CANCEL: $form_id = '\Drupal\civiremote_event\Form\RegistrationCancelForm'; break; } @@ -230,7 +230,7 @@ public function access(string $context, stdClass $event, string $profile = NULL) && ( $context == self::CONTEXT_CREATE && $event->can_register || $context == self::CONTEXT_UPDATE && $event->can_edit_registration - || $context == self::CONTEXT_CANCEL && $this->event->is_registered && $this->event->can_cancel_registration + || $context == self::CONTEXT_CANCEL && $event->is_registered && $event->can_cancel_registration ) && ( !isset($profile)