From 9091e034fdccd2bd8e84b74cb217698bb8bb812b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 22 Feb 2017 10:04:34 -0800 Subject: [PATCH] CRM_Mailing_ActionTokens - Degarde gracefully 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. --- CRM/Mailing/ActionTokens.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Mailing/ActionTokens.php b/CRM/Mailing/ActionTokens.php index 130b5cd1b2..28158cbbe6 100644 --- a/CRM/Mailing/ActionTokens.php +++ b/CRM/Mailing/ActionTokens.php @@ -61,6 +61,13 @@ class CRM_Mailing_ActionTokens extends \Civi\Token\AbstractTokenSubscriber { )); } + /** + * @inheritDoc + */ + public function checkActive(\Civi\Token\TokenProcessor $processor) { + return !empty($processor->context['mailingId']) || !empty($processor->context['mailing']); + } + /** * @inheritDoc */ -- 2.25.1