Skip to content
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

Remove call to getTokenDetails #21972

Merged
merged 2 commits into from
Nov 4, 2021
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Nov 4, 2021

Overview

Remove call to getTokenDetails

Before

Call to getTokenDetails calls the legacy token hook - but the results are not used

After

SImple api call to retrieve minimum required details

Technical Details

This is tested vi CRM_Event_Form_Task_BatchTest::testSubmitCancel

Comments

Note that after this getTokenDetails is still called from the Job.update_greetings - which ALSO calls tokenProcessor and from legacy mailings. Hence there is no reason to implement hookTokenValues anymore (although flexmailer should be required by extensions that offer tokens)

@civibot
Copy link

civibot bot commented Nov 4, 2021

(Standard links)

@civibot civibot bot added the master label Nov 4, 2021
This is tested vi CRM_Event_Form_Task_BatchTest::testSubmitCancel
This revises a very recent commit that touches `static $contactDetails` cache.

Imagine you have two calls to `transitionParticipants()` which involve different-but-overlapping sets:

* First invocation involves Alice and Bob
* Second invocation involves Bob and Carol

The first invocation loads Alice and Bob into `$contactDetails`.  The second
invocation identifies Carol as missing. We need to load Carol. Here's the change:

* Before: Carol overwrites Bob in `$contactDetails`. Bob goes missing.
* After: Alice, Bob, and Carol all exist in `$contactDetails`.
@totten
Copy link
Member

totten commented Nov 4, 2021

I confirmed that the test does give some coverage over this. (At least, you hack the code, you can break the test. 😃 ) Additionally, there is generally a fair amount of coverage over tokens and CiviEvent. Also, I poked into the function that receives the new NULL parameter - it appears to anticipate (and autofill) the NULL values. So that's all good.

I think there was a small edge-case bug in the cache maintenance. Pushed up a simple fix.

Merge on pass

@seamuslee001 seamuslee001 merged commit 513f6a4 into civicrm:master Nov 4, 2021
@seamuslee001 seamuslee001 deleted the gettok branch November 4, 2021 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants