-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(NFC) Enhance \Civi\Token\AbstractTokenSubscriber::prefetch() #13222
Conversation
…e list of active tokens Update CRM_Mailing_Tokens::prefetch() to match
(Standard links)
|
I agree this is the only core place where that function is overridden I guess the only question is whether anything outside core overrides it - since the class is in the Civi dir it could be argued it's a formal interface & we support extending it - the alternative would be for $activeTokens to be a class property & it would be set prior to calling prefetch - which would mean no signature change @totten do you have your universe tool keyed up to check that? |
I have just checked Flexmailer and it doesn't use the prefetch function does implement other things i thin but not prefetch |
@@ -72,7 +72,7 @@ public function checkActive(\Civi\Token\TokenProcessor $processor) { | |||
* @return array | |||
* @throws \Exception | |||
*/ | |||
public function prefetch(\Civi\Token\Event\TokenValueEvent $e) { | |||
public function prefetch(\Civi\Token\Event\TokenValueEvent $e, $activeTokens) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docblock? As someone browsing the code, it'd help to have an example of the data that will be passed in here.
Good question.
My copy is little dated but nothing shows up. (I'm half way through updating and haven't found anything relevant in the updates... unless there's no more feedback from me within the hour, you can asume nothing else came up.)
Correct. FlexMailer calls |
Thanks all. On reflection maybe making it a class property is better. I've made changes and pushed those to #13174 so I'll close this. |
Enhance \Civi\Token\AbstractTokenSubscriber::prefetch() to receive list of active tokens
Update CRM_Mailing_Tokens::prefetch() to match
Another extraction from #13174 and #12012