Skip to content

Commit

Permalink
Merge pull request #10895 from seamuslee001/CRM-21100-rc
Browse files Browse the repository at this point in the history
CRM-21100 Hotfix to ensure that testGroup list is still the same as p…
  • Loading branch information
eileenmcnaughton authored Aug 23, 2017
2 parents 8e3a6eb + 31815c2 commit 1d4e340
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CRM/Mailing/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public function getAngularModules() {
'options' => array('limit' => 0),
'sequential' => 1,
);

$groupNames = civicrm_api3('Group', 'get', $params + array(
'is_active' => 1,
'check_permissions' => TRUE,
'return' => array('title', 'visibility', 'group_type', 'is_hidden'),
));
$headerfooterList = civicrm_api3('MailingComponent', 'get', $params + array(
'is_active' => 1,
'return' => array('name', 'component_type', 'is_default', 'body_html', 'body_text'),
Expand Down Expand Up @@ -130,6 +134,8 @@ public function getAngularModules() {
'civiMails' => array(),
'campaignEnabled' => in_array('CiviCampaign', $config->enableComponents),
'groupNames' => array(),
// @todo see if we can remove this by dynamically generating the test group list
'testGroupNames' => $groupNames['values'],
'headerfooterList' => $headerfooterList['values'],
'mesTemplate' => $mesTemplate['values'],
'emailAdd' => $emailAdd['values'],
Expand Down
2 changes: 1 addition & 1 deletion ang/crmMailing/BlockPreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
ui-jq="crmSelect2"
ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Select Group')}"
ng-model="testGroup.gid"
ng-options="group.id as group.title for group in crmMailingConst.groupNames|orderBy:'title'"
ng-options="group.id as group.title for group in crmMailingConst.testGroupNames|orderBy:'title'"
class="crm-action-menu fa-envelope-o"
>
<option value=""></option>
Expand Down
2 changes: 1 addition & 1 deletion ang/crmMailing/BlockPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
scope.previewTestGroup = function(e) {
var $dialog = $(this);
$dialog.html('<div class="crm-loading-element"></div>').parent().find('button[data-op=yes]').prop('disabled', true);
$dialog.dialog('option', 'title', ts('Send to %1', {1: _.pluck(_.where(scope.crmMailingConst.groupNames, {id: scope.testGroup.gid}), 'title')[0]}));
$dialog.dialog('option', 'title', ts('Send to %1', {1: _.pluck(_.where(scope.crmMailingConst.testGroupNames, {id: scope.testGroup.gid}), 'title')[0]}));
CRM.api3('contact', 'get', {
group: scope.testGroup.gid,
options: {limit: 0},
Expand Down

0 comments on commit 1d4e340

Please sign in to comment.