-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-20577 - When creating an activity per-contact when sending letters, store the version with rendered tokens #10348
Conversation
@@ -335,9 +335,6 @@ public static function combineContributions($existing, $contribution, $separator | |||
* @param int $groupByID | |||
*/ | |||
public static function assignCombinedContributionValues($contact, $contributions, $groupBy, $groupByID) { | |||
if (!defined('CIVICRM_MAIL_SMARTY') || !CIVICRM_MAIL_SMARTY) { | |||
return; | |||
} | |||
CRM_Core_Smarty::singleton()->assign('contact_aggregate', $contact['contact_aggregate']); |
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.
This early return actually adds no value. No performance benefit and it makes it harder for extensions & unit tests to interact
Jenkins re test this please |
// This seems silly, but the old behavior was to first check `_cid` | ||
// and then use the provided `$contactIds`. Probably not even necessary, | ||
// but difficult to audit. | ||
$contactIds = $form->_cid ? array($form->_cid) : $form->_contactIds; |
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.
I've moved this weirdness out of the shared function to each form so we can work to remove it - impossible to ever get rid of it, per comments, if hidden in a shared function
b177614
to
d590739
Compare
In addition to the unit test there is a minor change to not do the early return before assigning variables if smarty is not set. This doesn't really have any performance advantage, as they are already calculated, blocks the unit test and also blocks using these variables from outside extensions
(At least, this covers contributions at this stage). I have also tried to move towards clearer inputs & outpus on createActivities, with the weirdness around contactIds being moved up to the forms themselves and not being passed in. Would prefer not to see form passed in either but, next time. Unit tests cover emails & activity create (for the first time)
Tested, working fine. The changes made in |
Thanks @monishdeb |
In addition to the unit test there is a minor change to not do the early return before assigning variables
if smarty is not set. This doesn't really have any performance advantage, as they are already calculated,
blocks the unit test and also blocks using these variables from outside extensions