Skip to content

Commit

Permalink
Merge pull request #11906 from JMAConsulting/dev-42
Browse files Browse the repository at this point in the history
(dev/mail/6) On multilingual mode, choosing mailing group doesn't affect recipient count and list
  • Loading branch information
eileenmcnaughton authored Apr 1, 2018
2 parents fd36ea7 + d84b6ff commit daeea75
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ public static function getRecipients($mailingID) {
$recipientsGroup = $excludeSmartGroupIDs = $includeSmartGroupIDs = $priorMailingIDs = array();
$dao = CRM_Utils_SQL_Select::from('civicrm_mailing_group')
->select('GROUP_CONCAT(entity_id SEPARATOR ",") as group_ids, group_type, entity_table')
->where('mailing_id = #mailing_id AND entity_table IN ("civicrm_group", "civicrm_mailing")')
->where('mailing_id = #mailing_id AND entity_table IN ("!groupTableName", "civicrm_mailing")')
->groupBy(array('group_type', 'entity_table'))
->param('!groupTableName', CRM_Contact_BAO_Group::getTableName())
->param('#mailing_id', $mailingID)
->execute();
while ($dao->fetch()) {
Expand Down Expand Up @@ -2878,25 +2879,6 @@ public static function getMailingsList($isSMS = FALSE) {
return $list;
}

/**
* @param int $mid
*
* @return null|string
*/
public static function hiddenMailingGroup($mid) {
$sql = "
SELECT g.id
FROM civicrm_mailing m
INNER JOIN civicrm_mailing_group mg ON mg.mailing_id = m.id
INNER JOIN civicrm_group g ON mg.entity_id = g.id AND mg.entity_table = 'civicrm_group'
WHERE g.is_hidden = 1
AND mg.group_type = 'Include'
AND m.id = %1
";
$params = array(1 => array($mid, 'Integer'));
return CRM_Core_DAO::singleValueQuery($sql, $params);
}

/**
* wrapper for ajax activity selector.
*
Expand Down

0 comments on commit daeea75

Please sign in to comment.