From f08f91a9537fb7450994a4de1f489369d455ba77 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 7 Feb 2015 05:42:41 -0800 Subject: [PATCH] CRM-15931 - civicrm_mailing_group.group_type - Read & write capitalized type --- CRM/Mailing/BAO/Mailing.php | 3 ++- js/angular-crmMailing/services.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index def033c034..1d762bb07d 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1680,10 +1680,11 @@ ORDER BY civicrm_email.is_bulkmail DESC /* Create the mailing group record */ $mg = new CRM_Mailing_DAO_MailingGroup(); + $groupTypes = array('include' => 'Include', 'exclude' => 'Exclude', 'base' => 'Base'); foreach (array('groups', 'mailings') as $entity) { foreach (array('include', 'exclude', 'base') as $type) { if (isset($params[$entity][$type])) { - self::replaceGroups($mailing->id, $type, $entity, $params[$entity][$type]); + self::replaceGroups($mailing->id, $groupTypes[$type], $entity, $params[$entity][$type]); } } } diff --git a/js/angular-crmMailing/services.js b/js/angular-crmMailing/services.js index c33a120ea2..889da1c55f 100644 --- a/js/angular-crmMailing/services.js +++ b/js/angular-crmMailing/services.js @@ -137,7 +137,7 @@ _.each(groupResult.values, function (mailingGroup) { var bucket = (/^civicrm_group/.test(mailingGroup.entity_table)) ? 'groups' : 'mailings'; var entityId = parseInt(mailingGroup.entity_id); - mailing[bucket][mailingGroup.group_type].push(entityId); + mailing[bucket][mailingGroup.group_type.toLowerCase()].push(entityId); }); }); }, -- 2.25.1