From 071c6f10b635099458b00c958fc8716f498090a2 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Wed, 4 Sep 2013 19:18:53 -0400 Subject: [PATCH] CRM-13341 add group_id clause to subscription confirm query --- CRM/Contact/BAO/GroupContact.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 34f16253ca..9d23870dd3 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -439,8 +439,11 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { $leftJoin = $where = $orderBy = null; if ($method) { - $leftJoin = - "LEFT JOIN civicrm_subscription_history ON (civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id)"; + //CRM-13341 add group_id clause + $leftJoin = " + LEFT JOIN civicrm_subscription_history + ON ( civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id + AND civicrm_subscription_history.group_id = {$groupID} )"; $where = "AND civicrm_subscription_history.method ='Email'"; $orderBy = "ORDER BY civicrm_subscription_history.id DESC"; } -- 2.25.1