From: Donald A. Lobo Date: Wed, 23 Oct 2013 18:56:39 +0000 (-0700) Subject: Fix notice when using acls to restrict mailing groups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8f46399481563f72588c19c4aff4c4aba3b46fe8;p=civicrm-core.git Fix notice when using acls to restrict mailing groups --- 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 ) )