Skip to content

Commit

Permalink
CRM_Mailing_ActionTokens - Degarde gracefully
Browse files Browse the repository at this point in the history
Most of the `CRM_*_Tokens` classes include a `checkActive()` function whic
prevents them from trying to do anything if they don't have the necessary
data.  However, this one was missing it, which means that it attempts to
evalute `{action.*}` tokens even when they're not valid.
  • Loading branch information
totten committed Feb 22, 2017
1 parent 7927bd0 commit 484fc04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CRM/Mailing/ActionTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ public function __construct() {
));
}

/**
* @inheritDoc
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
return
!empty($row->context['mailingJobId'])
&& !empty($row->context['mailingActionTarget']['hash']);
}

/**
* @inheritDoc
*/
Expand Down

0 comments on commit 484fc04

Please sign in to comment.