Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.6
-
Fix Version/s: 4.3.0
-
Component/s: Internationalisation
-
Labels:None
Description
This fixes the problem:
— CRM/Mailing/Form/Group.php.orig 2012-12-05 12:55:44.000000000 -0500
+++ CRM/Mailing/Form/Group.php 2012-12-05 17:13:35.000000000 -0500
@@ -111,11 +111,19 @@
$mailingGroups[$dao->entity_table][$dao->group_type][] = $dao->entity_id;
}
- $defaults['includeGroups'] = $mailingGroups['civicrm_group']['Include'];
- $defaults['excludeGroups'] = CRM_Utils_Array::value('Exclude', $mailingGroups['civicrm_group']);
+ global $dbLocale;
+ $civicrm_group = 'civicrm_group';
+ $civicrm_mailing = 'civicrm_mailing';
+ if($dbLocale) { + $civicrm_group .= $dbLocale; + $civicrm_mailing .= $dbLocale; + }+
+ $defaults['includeGroups'] = $mailingGroups[$civicrm_group]['Include'];
+ $defaults['excludeGroups'] = CRM_Utils_Array::value('Exclude', $mailingGroups[$civicrm_group]);
- $defaults['includeMailings'] = CRM_Utils_Array::value('Include', $mailingGroups['civicrm_mailing']);
- $defaults['excludeMailings'] = $mailingGroups['civicrm_mailing']['Exclude'];
+ $defaults['includeMailings'] = CRM_Utils_Array::value('Include', $mailingGroups[$civicrm_mailing]);
+ $defaults['excludeMailings'] = $mailingGroups[$civicrm_mailing]['Exclude'];
}
//when the context is search hide the mailing recipients.
However... i wonder if there isn't a utility function that should do this. I didn't see anything in CRM/Core/I18n/Schema.php. Maybe if we added a static function there, the code would look more like:
$civicrm_group = CRM_Core_l18n_Schema::getTableName('civicrm_group');
And it would auto-detect whether to return 'civicrm_group' if localizations is not enabled or the properly localized table name if it is.
Feel free to re-assign back to me if you have suggestions on how I should implement (and whether I should commit to 4.2 or head).
Thanks!
jamie