Skip to content

Commit

Permalink
Fix typo in event form access check for cancelling
Browse files Browse the repository at this point in the history
  • Loading branch information
jensschuppe committed Feb 22, 2024
1 parent 2b14c33 commit b1a7e86
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b1a7e86

Please sign in to comment.