From 985af4675c92e09eb9e22b806fe8ddb4c473af83 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Wed, 12 Aug 2015 17:38:29 -0400 Subject: [PATCH] CRM-16981 - Incorporate Seamus Lee's suggestion to make mailing visibility dependent on domain --- CRM/Mailing/BAO/Mailing.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 408eaf37f3..523837ac24 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2411,6 +2411,7 @@ ORDER BY civicrm_email.is_bulkmail DESC } if (!empty($groups)) { $groupIDs = implode(',', array_keys($groups)); + $domain_id = CRM_Core_Config::domainID(); // get all the mailings that are in this subset of groups $query = " @@ -2418,7 +2419,7 @@ SELECT DISTINCT( m.id ) as id FROM civicrm_mailing m LEFT JOIN civicrm_mailing_group g ON g.mailing_id = m.id WHERE ( ( g.entity_table like 'civicrm_group%' AND g.entity_id IN ( $groupIDs ) ) - OR ( g.entity_table IS NULL AND g.entity_id IS NULL ) ) + OR ( g.entity_table IS NULL AND g.entity_id IS NULL AND m.domain_id = $domain_id ) ) "; $dao = CRM_Core_DAO::executeQuery($query); -- 2.25.1