(REF) Tokens - Populate "Event"/"Participant" without direct access to actionSearchResult
authorTim Otten <totten@civicrm.org>
Wed, 13 Oct 2021 03:02:51 +0000 (20:02 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 13 Oct 2021 03:02:51 +0000 (20:02 -0700)
commit9cb7f52255ddd29541e07317b2c57e67a2ce625b
tree120c4ffe5f18bcb5a74551b2bbb540244cd07839
parent1adcb71709099b424e6c3a5985c9b6dc9be9559e
(REF) Tokens - Populate "Event"/"Participant" without direct access to actionSearchResult

Overview
--------

When sending a scheduled remidner for a `civicrm_participant` record, it supports
tokens for both `{participant.*}` (`$context['participantId']`) and `{event.*}`
(`$context['eventId']`). This creates a special requirement to load the `eventId`
in addition to the `participantId`.

This patch changes the way in which `eventId` is loaded.

Before
------

In `ParticipantToken`, the token-evaluation-step for `{participant.*}`
tokens has a side-effect of copying `$context['eventId']` based on reading
`actionSearchResult` (although this appears indirect).

After
-----

The action-search returns `tokenContext_eventId`, which automatically maps
to `$context['eventId']`.

This means that the `eventId` will be set before evaluation begins.
CRM/Event/ParticipantTokens.php
CRM/Event/Tokens.php