From: kurund Date: Wed, 4 Mar 2015 10:14:14 +0000 (+0530) Subject: re-adding PR-5111 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=92d6bfcf9aff8f8894834498f85f22259427a46f;p=civicrm-core.git re-adding PR-5111 --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 09cfd0e076..1414f95f11 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1607,6 +1607,7 @@ 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]) && !empty($params[$entity][$type]) && @@ -1616,7 +1617,7 @@ ORDER BY civicrm_email.is_bulkmail DESC $mg->mailing_id = $mailing->id; $mg->entity_table = ($entity == 'groups') ? $groupTableName : $mailingTableName; $mg->entity_id = $entityId; - $mg->group_type = $type; + $mg->group_type = $groupTypes[$type]; $mg->save(); } } diff --git a/CRM/Mailing/Form/Group.php b/CRM/Mailing/Form/Group.php index 45e83e6573..0eabfee791 100644 --- a/CRM/Mailing/Form/Group.php +++ b/CRM/Mailing/Form/Group.php @@ -143,12 +143,12 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { $mailingGroups[$entityTable][$dao->group_type][] = $dao->entity_id; } - $defaults['includeGroups'] = CRM_Utils_Array::value('include', $mailingGroups['civicrm_group']); - $defaults['excludeGroups'] = CRM_Utils_Array::value('exclude', $mailingGroups['civicrm_group']); + $defaults['includeGroups'] = CRM_Utils_Array::value('Include', $mailingGroups['civicrm_group']); + $defaults['excludeGroups'] = CRM_Utils_Array::value('Exclude', $mailingGroups['civicrm_group']); if (!empty($mailingGroups['civicrm_mailing'])) { - $defaults['includeMailings'] = CRM_Utils_Array::value('include', $mailingGroups['civicrm_mailing']); - $defaults['excludeMailings'] = CRM_Utils_Array::value('exclude', $mailingGroups['civicrm_mailing']); + $defaults['includeMailings'] = CRM_Utils_Array::value('Include', $mailingGroups['civicrm_mailing']); + $defaults['excludeMailings'] = CRM_Utils_Array::value('Exclude', $mailingGroups['civicrm_mailing']); } } diff --git a/CRM/Upgrade/Incremental/sql/4.5.7.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.7.mysql.tpl new file mode 100644 index 0000000000..3becf6350c --- /dev/null +++ b/CRM/Upgrade/Incremental/sql/4.5.7.mysql.tpl @@ -0,0 +1,6 @@ +{* file to handle db changes in 4.5.7 during upgrade *} + +-- CRM-15931 +UPDATE civicrm_mailing_group SET group_type = 'Include' WHERE group_type = 'include'; +UPDATE civicrm_mailing_group SET group_type = 'Exclude' WHERE group_type = 'exclude'; +UPDATE civicrm_mailing_group SET group_type = 'Base' WHERE group_type = 'base'; diff --git a/xml/version.xml b/xml/version.xml index 87514d7e01..421c80e7bc 100644 --- a/xml/version.xml +++ b/xml/version.xml @@ -1,4 +1,4 @@ - 4.5.6 + 4.5.7