X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FActivity%2FTokens.php;h=fff8e6224a507fe684cf1465cbf0881d7365ca91;hb=0def915b5bdab4f9d4cbc5980e2bdf6013eac926;hp=e8d875c5e7ad852fc16f5d0b1fe9d3d9a2af19a3;hpb=64c50b693785c6c7ed9a9a7fe8f360e8dc667ab0;p=civicrm-core.git diff --git a/CRM/Activity/Tokens.php b/CRM/Activity/Tokens.php index e8d875c5e7..fff8e6224a 100644 --- a/CRM/Activity/Tokens.php +++ b/CRM/Activity/Tokens.php @@ -48,12 +48,10 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber { } /** - * Get the name of the field which holds the ID of the given entity. - * * @return string */ - private function getEntityIDFieldName(): string { - return 'activity_id'; + private function getEntityContextSchema(): string { + return 'activityId'; } /** @@ -90,7 +88,7 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber { // Find all the entity IDs $entityIds = $e->getTokenProcessor()->getContextValues('actionSearchResult', 'entityID') - + $e->getTokenProcessor()->getContextValues($this->getEntityIDFieldName()); + + $e->getTokenProcessor()->getContextValues($this->getEntityContextSchema()); if (!$entityIds) { return NULL; @@ -124,8 +122,6 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber { /** * @inheritDoc - * - * @throws \CRM_Core_Exception */ public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) { // maps token name to api field @@ -134,7 +130,7 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber { ]; // Get ActivityID either from actionSearchResult (for scheduled reminders) if exists - $activityId = $row->context['actionSearchResult']->entityID ?? $row->context[$this->getEntityIDFieldName()]; + $activityId = $row->context['actionSearchResult']->entityID ?? $row->context[$this->getEntityContextSchema()]; $activity = (object) $prefetch['activity'][$activityId];