-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Fix campaign_id handling for batch entry #18792
Conversation
(Standard links)
|
@jitendrapurohit is this one you could review? |
CRM/Batch/Form/Entry.php
Outdated
@@ -838,7 +831,7 @@ private function processMembership(&$params) { | |||
$value['contact_id'], $value['membership_type_id'], FALSE, | |||
//$numTerms should be default to 1. | |||
NULL, NULL, $value['custom'], 1, NULL, FALSE, | |||
NULL, $membershipSource, $isPayLater, $campaignId, $formDates | |||
NULL, $membershipSource, $isPayLater, ['campaign_id' => $value['campaign_id'] ?? NULL], $formDates |
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 element build on the batch entry form is member_campaign_id
so think we should replace the key in $value
with the same? The patch after being applied is still not able to update the campaign in the membership due to the above mismatch. Replacing it with
NULL, $membershipSource, $isPayLater, ['campaign_id' => $value['member_campaign_id'] ?? NULL], $formDates
works fine. @eileenmcnaughton Can you confirm pls?
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.
thanks @jitendrapurohit I've updated it as you suggest
Fixes a bug whereby campaign_id is not updated on batch entry if it has been added to the profile. The underlying issue appears to be an attack of copy and paste. I tidied up the variable in both the places that call the processMembership function such that it is passed in as an array of pass-through params. The function can be simplified & eventually removed.
f7e70bd
to
5fbbde1
Compare
Jenkins re test this please |
Have tested multiple membership renewals via batch screen. This is working fine now 👍 |
@colemanw @seamuslee001 could one of you merge based on @jitendrapurohit review |
Merging as per review by @jitendrapurohit |
Overview
Fixes a bug whereby campaign_id is not updated on batch entry if it has been added to the profile.
Before
After
Campaign id saved & tested.
Technical Details
The underlying issue appears to be an attack of copy and paste. I tidied up the variable
in both the places that call the processMembership function such that it is passed in
as an array of pass-through params. Campaign id is the only param treated this way for now - but several of the params are in fact simply part of the array of 'memParams' that is passed through.
The function processMembership can be simplified & eventually removed building off this.
Comments
Pre-existing e-notice not addressed - it's in the buildForm & I'm looking at the post process. Unrelated