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

CRM-20562: Duplicate Activities created during participant registration v… #10362

Merged
merged 2 commits into from
May 19, 2017

Conversation

jitendrapurohit
Copy link
Contributor

@jitendrapurohit jitendrapurohit commented May 15, 2017

…ia completetransaction.

As all required activities already gets created above while calling participant create api, writing addActivity() again would be an additional creation on them. Removing this call as I don't find any use-case where these lines might be required.

https://issues.civicrm.org/jira/browse/CRM-20562

@jitendrapurohit jitendrapurohit changed the title CRM-20562: Wrong Activities created during participant registration v… CRM-20562: Duplicate Activities created during participant registration v… May 16, 2017
@@ -2107,6 +2107,7 @@ public static function addActivity(
$id = CRM_Core_Session::getLoggedInContactID();
if ($id) {
$activityParams['source_contact_id'] = $id;
$activityParams['target_contact_id'][] = $activity->contact_id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the logic here? I worry there might be cases where it is not populated..

Copy link
Contributor Author

@jitendrapurohit jitendrapurohit May 17, 2017

Choose a reason for hiding this comment

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

This is required when registering an additional participant and activity gets created for only primary contact. As we get the logged in contact id we replace the source_contact with it.

Keeping the $activity->contact_id in target would show the activities for additional participant too.

shall I check for !empty($activity->contact_id) in case this might not populate but I see this has been already assigned to source_contact which is being replaced here, so it should always be there?

Copy link
Member

Choose a reason for hiding this comment

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

I agree with the tweak here.

Copy link
Member

@monishdeb monishdeb left a comment

Choose a reason for hiding this comment

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

Tested, working fine

@monishdeb monishdeb merged commit 629574b into civicrm:master May 19, 2017
@jitendrapurohit jitendrapurohit deleted the CRM-20562 branch May 19, 2017 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants