Merge pull request #23164 from mlutfy/eventCancelWaitlist
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 20 Apr 2022 00:55:01 +0000 (12:55 +1200)
committerGitHub <noreply@github.com>
Wed, 20 Apr 2022 00:55:01 +0000 (12:55 +1200)
Event self-service cancel: allow cancelling Waitlist registration

1  2 
CRM/Event/BAO/Participant.php

index 2684907be0a0b2ad6d2de169346ac98921c3aa13,0cb57b998964c0d676506c50f396b09f502a391c..858f4aca553834ed5f032cf546bbdb07d7dac60e
@@@ -1866,10 -1866,10 +1866,10 @@@ WHERE    civicrm_participant.contact_i
        $details['ineligible_message'] = ts('This event registration can not be transferred or cancelled. Contact the event organizer if you have questions.');
        return $details;
      }
-     //verify participant status is still Registered
-     if ($details['status'] != 'Registered') {
+     // Verify participant status is one that can be self-cancelled
+     if (!in_array($details['status'], ['Registered', 'Pending from pay later', 'On waitlist'])) {
        $details['eligible'] = FALSE;
 -      $details['ineligible_message'] = "You cannot transfer or cancel your registration for " . $eventTitle . ' as you are not currently registered for this event.';
 +      $details['ineligible_message'] = ts('You cannot transfer or cancel your registration for %1 as you are not currently registered for this event.', [1 => $eventTitle]);
        return $details;
      }
      // Determine if it's too late to self-service cancel/transfer.