From 8f46399481563f72588c19c4aff4c4aba3b46fe8 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Wed, 23 Oct 2013 11:56:39 -0700 Subject: [PATCH] Fix notice when using acls to restrict mailing groups --- CRM/Mailing/BAO/Mailing.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index ea6b788084..b2f360d523 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2161,11 +2161,10 @@ ORDER BY civicrm_email.is_bulkmail DESC $groups = CRM_Core_PseudoConstant::group(NULL, FALSE); if (!empty($groups)) { $groupIDs = implode(',', array_keys($groups)); - $selectClause = ($count) ? 'COUNT( DISTINCT m.id) as count' : 'DISTINCT( m.id ) as id'; // get all the mailings that are in this subset of groups $query = " -SELECT $selectClause +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 ) ) -- 2.25.1