Skip to content

Commit

Permalink
Merge pull request #865 from christophlehmann/bugfix-event-may-not-exist
Browse files Browse the repository at this point in the history
[BUGFIX] Handle non-existent event in checkCancelRegistration()
  • Loading branch information
derhansen authored Apr 4, 2021
2 parents 257c3cb + 5302e5c commit 404f77a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Service/RegistrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ public function checkCancelRegistration($reguid, $hmac)
$titleKey = 'cancelRegistration.title.failed';
}

if (!$failed && is_null($registration->getEvent())) {
$failed = true;
$messageKey = 'event.message.cancel_failed_event_not_found';
$titleKey = 'cancelRegistration.title.failed';
}

if (!$failed && $registration->getEvent()->getEnableCancel() === false) {
$failed = true;
$messageKey = 'event.message.confirmation_failed_cancel_disabled';
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@
<trans-unit id="event.message.confirmation_failed_registration_not_found">
<source>Confirmation failed, registration not found.</source>
</trans-unit>
<trans-unit id="event.message.cancel_failed_event_not_found">
<source>Cancellation failed, event not found.</source>
</trans-unit>
<trans-unit id="event.message.confirmation_failed_confirmation_until_expired">
<source>Confirmation failed, confirmation date has expired.</source>
</trans-unit>
Expand Down

0 comments on commit 404f77a

Please sign in to comment.