From 1006a98ea6fd2985a42b0d2262b6215ef40f7341 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 12 Oct 2021 20:06:25 -0700 Subject: [PATCH] (REF) ParticipantTokens - Simplify The previous commit passes `eventId` through the front-door of `$context`, so we shouldn't need as much special effort to bring it in the side-door. --- CRM/Event/ParticipantTokens.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/CRM/Event/ParticipantTokens.php b/CRM/Event/ParticipantTokens.php index 9863bf6566..b29050fcf1 100644 --- a/CRM/Event/ParticipantTokens.php +++ b/CRM/Event/ParticipantTokens.php @@ -10,7 +10,6 @@ +--------------------------------------------------------------------+ */ -use Civi\Token\Event\TokenValueEvent; use Civi\Token\TokenRow; /** @@ -20,13 +19,6 @@ use Civi\Token\TokenRow; */ class CRM_Event_ParticipantTokens extends CRM_Core_EntityTokens { - public static function getSubscribedEvents() { - $events = parent::getSubscribedEvents(); - // Set the weight so it runs before event tokens. - $events['civi.token.eval'] = ['evaluateTokens', 400]; - return $events; - } - /** * Get the entity name for api v4 calls. * @@ -43,21 +35,6 @@ class CRM_Event_ParticipantTokens extends CRM_Core_EntityTokens { return ['fee_currency']; } - /** - * To handle variable tokens, override this function and return the active tokens. - * - * @param \Civi\Token\Event\TokenValueEvent $e - * - * @return mixed - */ - public function getActiveTokens(TokenValueEvent $e) { - $messageTokens = $e->getTokenProcessor()->getMessageTokens(); - if (!isset($messageTokens[$this->entity])) { - return isset($messageTokens['event']) ? ['event_id'] : FALSE; - } - return parent::getActiveTokens($e); - } - /** * Get any tokens with custom calculation. */ -- 2.25.1