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

dev/core#352 Ensure that contacts that are to be exluded are not adde… #12712

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

seamuslee001
Copy link
Contributor

…d incorrectly when adding recipients of past mailings

Overview

When using recipients from a previous mailing as the recipients of a mailing. If any exclusion groups / mailings. The contacts in these are groups / mailings are not properly removed when adding the recipients of the mailing for inclusion.

Before

Contacts wrongly included in emails when previous mailing used as the inclusion

After

Contacts not wrongly included and unit test added

ping @eileenmcnaughton @monishdeb @totten @andrew-cormick-dockery @jtwyman

@civibot
Copy link

civibot bot commented Aug 22, 2018

(Standard links)

@@ -282,8 +282,10 @@ public static function getRecipients($mailingID) {
// Get recipients selected in prior mailings
if (!empty($priorMailingIDs['Include'])) {
CRM_Utils_SQL_Select::from('civicrm_mailing_recipients')
->select("contact_id, $entityColumn")
->select("civicrm_mailing_recipients.contact_id, $entityColumn")
Copy link
Member

Choose a reason for hiding this comment

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

can you also add DISTINCT to select clause mostly on queries which involve temp table? because lately I encountered a issue that temp table are populated with duplicate entries and this causes performance issue in menu rebuild

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@monishdeb sure

Copy link
Member

@monishdeb monishdeb Aug 27, 2018

Choose a reason for hiding this comment

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

As you can see here the old code got DISTINCT in select clauses and this change has been lost during refactoring :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@monishdeb added now

…d incorrectly when adding recipients of past mailings

Add in DISTINCT clause as per Moonish's comment
@eileenmcnaughton
Copy link
Contributor

OK I took a look through this & per @seamuslee001 the exclude join is present in other places, just not this one. Merging. Yay test

@eileenmcnaughton eileenmcnaughton merged commit 710bf05 into civicrm:master Aug 28, 2018
@eileenmcnaughton eileenmcnaughton deleted the dev_core_352 branch August 28, 2018 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants