From: Kurund Jalmi Date: Wed, 25 Oct 2023 22:06:49 +0000 (+0100) Subject: test fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aafcc3ffcfcbc4ac3a86690a083de71a950ebcac;p=civicrm-core.git test fixes --- diff --git a/ext/afform/core/Civi/Afform/Tokens.php b/ext/afform/core/Civi/Afform/Tokens.php index 093f1b02b0..c7b901f944 100644 --- a/ext/afform/core/Civi/Afform/Tokens.php +++ b/ext/afform/core/Civi/Afform/Tokens.php @@ -111,6 +111,11 @@ class Tokens extends AutoService implements EventSubscriberInterface { } public static function listTokens(\Civi\Token\Event\TokenRegisterEvent $e) { + // this tokens should be available only in contact context i.e. in Message Templates (add/edit) + if (!in_array('contactId', $e->getTokenProcessor()->getContextValues('schema')[0])) { + return; + } + $e->entity('afformSubmission') ->register('validateSubmissionUrl', E::ts('Validate Submission URL')) ->register('validateSubmissionLink', E::ts('Validate Submission (Full Hyperlink)'));