Details
Description
Symptom I noticed is when viewing the CiviMail Mailing Report (click on Report action link from a draft, scheduled or sent mailing) [civicrm/mailing/report?mid=1&reset=1] - the report shows both Included and Excluded groups as "Excluded".
I narrowed this down to the code snippet below from CRM_Mailing_BAO_Mailing::report - which is expecting group_type = 'Included', 'Excluded' or 'Base'. In my DB, mailing_group.group_type strings are lower case (e.g. 'included', 'excluded'). This causes the if statement to fail.
There are a few other spots in Mailing_BAO which also expect mixed case and I suspect they are also messing up. I tried to determine where the group_type strings are set - but couldn't find it.
=======
/* Rename hidden groups */
if ($mailing->group_hidden == 1)
{ $row['name'] = "Search Results"; }if ($mailing->group_type == 'Include')
{ $report['group']['include'][] = $row; }elseif ($mailing->group_type == 'Base')
{ $report['group']['base'][] = $row; }else
{ $report['group']['exclude'][] = $row; }
This smells like a regression in 4.5 – we changed the way in which enums are represented in SQL. In 4.4, that SQL column is declared as "enum('Include','Exclude','Base') COLLATE utf8_unicode_ci" – which I think means you can insert lower-case "include" and then get back capitalized "Include". In 4.5/4.6, we switched all enums to varchars – which means that case is preserved.