/* 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]) &&
$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();
}
}
$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']);
}
}
--- /dev/null
+{* 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';
<?xml version="1.0" encoding="iso-8859-1" ?>
<version>
- <version_no>4.5.6</version_no>
+ <version_no>4.5.7</version_no>
</version>