Skip to content
Snippets Groups Projects
Unverified Commit af1fcb5b authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #16208 from mattwire/activitytokensfixcaseid

Fix activity.case_id token to always display the first case ID
parents 2fc7d585 28f7a9b1
Branches 4.7.9-rc
Tags 4.7.9
No related merge requests found
......@@ -197,6 +197,11 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
elseif (in_array($field, ['campaign'])) {
$row->tokens($entity, $field, $this->campaigns[$activity->campaign_id]);
}
elseif (in_array($field, ['case_id'])) {
// An activity can be linked to multiple cases so case_id is always an array.
// We just return the first case ID for the token.
$row->tokens($entity, $field, is_array($activity->case_id) ? reset($activity->case_id) : $activity->case_id);
}
elseif (array_key_exists($field, $this->customFieldTokens)) {
$row->tokens($entity, $field,
isset($activity->$field)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment