-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
Simplify params to legacyProcessMembership #32224
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
@@ -1497,7 +1494,9 @@ protected function postProcessMembership( | |||
date('YmdHis'), $membershipParams['cms_contactID'] ?? NULL, | |||
$customFieldsFormatted, | |||
$numTerms, $membershipID, $pending, | |||
$contributionRecurID, $membershipSource, $isPayLater, $memParams, $membershipContribution, | |||
$contributionRecurID, $membershipSource, $isPayLater, | |||
$this->_params['campaign_id'] ?? ($this->_values['campaign_id'] ?? NULL), |
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.
Transferring comment from @eileenmcnaughton from #32222:
Could probably even ditch it & use $this->getContributionPageValue('campaign_id') in the next function down - or do we think it might be possible to have campaign_id in a profile (probably they would do something weird & prefix it anyway :-)) - if so then the next level down could still do
$this->getSubmittedValue('campaign_id') ?: $this->getContributionPageValue('campaign_id')
I'm pretty sure I fixed these pages so that getSubmittedValue() also works on the Confirm page
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.
@eileenmcnaughton Hmm, ok I looked into this and you are probably right but it would require quite a bit more debugging / testing than I have time to do right now because campaign_id does get set/changed in a few places.
I've updated the PR and left a comment to help the next person :-) Can we merge as-is?
dc67e94
to
27f64ba
Compare
@@ -2675,14 +2677,14 @@ public static function unitTestAccessTolegacyProcessMembership($contactID, $memb | |||
* @param int $contributionRecurID | |||
* @param $membershipSource | |||
* @param $isPayLater | |||
* @param array $memParams | |||
* @param int? $campaignID |
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.
Like on the line below it would be int|null
but not worth holding it up.
Thanks @demeritcowboy |
Overview
This just simplifies one of the parameters to
CRM_Contribution_Form_Confirm::legacyProcessMembership()
so it's easier to read/refactor.Before
array passed in containing campaign_id
After
campaign_id passed in directly
Technical Details
Comments