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

Add test for selvsvctransfer, remove use of $contact from template #21855

Merged
merged 3 commits into from
Oct 29, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 18, 2021

Overview

Add test for selvsvctransfer, remove from template

Note this incorporates #21925

Before

No test, shipped template refers to assigned smarty variable, uses legacy method to get contact details

After

Test, limited replacement of smarty variable
Uses the api to get contact details (to keep it simply I stuck with v3 api)

Technical Details

I realised that I can't go further in this PR in terms of testing for domain tokens as I need the test utility in #21847 merged before I can leverage it. Interms of regenerating the sql I also need that merged as this will just conflict.

Comments

@civibot
Copy link

civibot bot commented Oct 18, 2021

(Standard links)

@civibot civibot bot added the master label Oct 18, 2021
@eileenmcnaughton eileenmcnaughton force-pushed the part branch 3 times, most recently from 23f4f02 to d171f73 Compare October 19, 2021 02:41
@eileenmcnaughton eileenmcnaughton force-pushed the part branch 2 times, most recently from b3a6e6b to 1ab17d9 Compare October 26, 2021 19:16
@eileenmcnaughton
Copy link
Contributor Author

rebased over #21925

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy if you have a chance to look at this one it's one more call to the legacy hook token function removed

@monishdeb
Copy link
Member

@eileenmcnaughton I have merged #21925 and I am expecting the current should contain the upgrade and unit-test changes, instead, it includes the patch already merged in master. Or does the PR need rebase?

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb that PR was only a minor change - I've rebased over it though. There was an earlier change that some comments abover related to

$mailType
) {
//send emails.
$mailSent = FALSE;

if (!$contactDetails) {
$contactDetails = civicrm_api3('Contact', 'getsingle', [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it worries me whenever I see getsingle API call without safeguarding mandatory parameter that might lead to a fatal error. Can you put !empty($participantValues['contact_id']) in IF condition ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monishdeb I feel like it would be an error if it were not set - so it's better to get an error

@monishdeb
Copy link
Member

Tested on 5.44.x upgrade, looks good. Reviewed patch, didn't encounter any breakage.

@monishdeb monishdeb merged commit 88d97cc into civicrm:master Oct 29, 2021
@eileenmcnaughton eileenmcnaughton deleted the part branch October 29, 2021 05:53
@eileenmcnaughton
Copy link
Contributor Author

Thanks @monishdeb - we are getting close to the goal of only calling hook_tokenValues from TokenProcessor....

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.

2 participants