-
-
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
dev/core#2554 Remove code to assign contact to the template in sendEmail #21490
Conversation
(Standard links)
|
Is this the same logic as the other one? This removes both hook_tokens and hook_tokenValues. And you can change the $details and hence the $values. I should probably look at what the extension does. |
@demeritcowboy yep - the same as the other one - so the |
Just noting that https://lab.civicrm.org/dev/core/-/issues/2554 is closable once this is merged - not sure if we can put Fixes dev/core#2554 anywhere to make that happen |
A couple notes. The first one is the main one.
|
@demeritcowboy so I feel like the main plan here would be to communicate - I have added it to the merge notes & it will be in the dev-digest & release notes I think removing this line https://github.com/eileenmcnaughton/legacytokenhelper/blob/master/legacytokenhelper.php#L203 might solve 1 tho? |
@demeritcowboy I removed the above line eileenmcnaughton/legacytokenhelper@07ec1bf - I think the extension was meant to ensure assignment not to parse it |
Hmm ... just having the extension installed seems to make it replace {contact.display_name} with the wrong contact (it seems to be the contact who's contact id is the case id, as if it's flipping the ids). And what gets assigned as the {$contact} variable is an array keyed on id (before it was just the array), and it doesn't have the same number of items that used to be in $values. Is it worth pursuing having the extension? I don't have any real sense of how many people are doing things like accessing {$contact.contact_id} or branching like |
I added a suggested line to the dev digest draft. |
@demeritcowboy ok - let's just use the dev digest to communicate this + release notes & worry about honing the extension if anywone actually cares about the functionality? There are a few copy & paste places affected & they make the code much more unmaintainable for a possible feature but possibly just accident |
@colemanw any thoughts? The underlying issue is we spend a tonne of code & complexity to assign |
That last part isn't entirely true. It contains a couple like is_deceased regardless, or you can add values if you've used hooks in a weird way. I'm ok to merge this but people are going to need to test their setups, not just because of this PR, but because there's a large of number of token and messaging things moved around in 5.43. |
@demeritcowboy ok - lets' do it - it makes a huge difference to being able to make the code sane & we already have a big communication / testsing task around tokens next release - it will go down better if we can get to the part of adding functionality ;-) |
side point
can also be expressed as
since the token is resolved first |
Is that order something new because you used to have to do {capture} first to get the text? |
@demeritcowboy I don't think so - I think we use capture for a combo of reasons we need to use capture & things we are confused about... |
Overview
Remove code to assign contact to the template in sendEmail
Same logic as #21475
Before
Code does a lot of work to generate the variable
$contact
which is assigned to the template & usable IF CIVICRM_MAIL_Smarty is defined & trueAfter
Code removed - if sites really want this the can install https://github.com/eileenmcnaughton/legacytokenhelper
However, in my analysis for that I decided it was basically useless as only the requested tokens would be added to the assigned
$contact
objectTechnical Details
@demeritcowboy
Comments
Docs https://lab.civicrm.org/documentation/docs/sysadmin/-/merge_requests/318