-
-
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#2344 unit test for fix regression affecting sending thank you letters when grouped #19481
Conversation
(Standard links)
|
@@ -336,7 +339,7 @@ public static function combineContributions($existing, $contribution, $separator | |||
public static function assignCombinedContributionValues($contact, $contributions, $groupBy, $groupByID) { | |||
CRM_Core_Smarty::singleton()->assign('contact_aggregate', $contact['contact_aggregate']); | |||
CRM_Core_Smarty::singleton() | |||
->assign('contributions', array_intersect_key($contributions, $contact['contribution_ids'][$groupBy][$groupByID])); |
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.
contributions is now passed in pre-filtered
$categories = self::getTokenCategories(); | ||
$domain = CRM_Core_BAO_Domain::getDomain(); | ||
$tokenHtml = CRM_Utils_Token::replaceDomainTokens($html_message, $domain, TRUE, $messageToken); | ||
$tokenHtml = CRM_Utils_Token::replaceContactTokens($tokenHtml, $contact, TRUE, $messageToken); | ||
if ($grouped) { | ||
$tokenHtml = CRM_Utils_Token::replaceMultipleContributionTokens($separator, $tokenHtml, $contribution, TRUE, $messageToken); |
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.
The 'TRUE' is eventually ignored so not needed as a param
c559413
to
f54788f
Compare
8d8a30d
to
ec6e4b4
Compare
ec6e4b4
to
4002221
Compare
Jenkins re test this please |
Still the sql gone away fails :-( |
Jenkins re test this please |
Test fails unrelated |
Overview
dev/core#2344 fix regression affecting sending thank you letters when grouped
Before
After
PDF rendered, added test passes
Technical Details
The regression was caused by #18714 - however, the fix makes the approach less flakey,.
replaceMultipleContributionTokens
(only called from one place) was passing in an array where the tokens were already concatenated & expecting thereplaceContributionTokens
to swap them out as is.The new approach uses replaceContributionTokens to do the replacing on each contribution (one at a time) and then concatenates the resolved tokens, before using a different function
token_replace
to do the actual replacements.Although this code is a bit hardwork it is mostly not called from other places
Comments
https://lab.civicrm.org/dev/core/-/issues/2344