Skip to content

Commit

Permalink
Merge pull request #13361 from seamuslee001/lab_core_594
Browse files Browse the repository at this point in the history
(dev/core#594) Fix key-value mappings for WYSIWYG setting (editor_id). Accept keyColumn option.
  • Loading branch information
seamuslee001 authored Dec 28, 2018
2 parents 165a5ec + 91f4c3f commit 5862ef4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CRM/Upgrade/Incremental/php/FiveNine.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
1 => ts('Enable multiple bulk email address for a contact'),
2 => ts('Email on Hold'),
);
$postUpgradeMessage .= '<p>' . ts('If the setting "%1" is enabled, you should update any smart groups based on the "%2" field.', $args) . '</p>';
$postUpgradeMessage .= '<p>' . ts('If the setting "%1" is enabled, you should update any smart groups based on the "%2" field.', $args) . '</p>' .
'<p>' . ts('If you were previously on version 5.8 and altered the WYSIWYG editor setting, you should visit the <a %1>Display Preferences</a> page and re-save the WYSIWYG editor setting.', array(1 => 'href="' . CRM_Utils_System::url('civicrm/admin/setting/preferences/display', 'reset=1') . '"')) . '</p>';
}

// Example: Generate a post-upgrade message.
Expand Down
6 changes: 5 additions & 1 deletion api/v3/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ function civicrm_api3_setting_getoptions($params) {
return civicrm_api3_create_success($values, $params, 'Setting', 'getoptions');
}
elseif (!empty($pseudoconstant['optionGroupName'])) {
$keyColumn = 'value';
if (!empty($pseudoconstant['keyColumn'])) {
$keyColumn = $pseudoconstant['keyColumn'];
}
return civicrm_api3_create_success(
CRM_Core_OptionGroup::values($pseudoconstant['optionGroupName'], FALSE, FALSE, TRUE),
CRM_Core_OptionGroup::values($pseudoconstant['optionGroupName'], FALSE, FALSE, TRUE, NULL, 'label', TRUE, FALSE, $keyColumn),
$params, 'Setting', 'getoptions'
);
}
Expand Down
1 change: 1 addition & 0 deletions settings/Core.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
'title' => ts('Wysiwig Editor'),
'pseudoconstant' => array(
'optionGroupName' => 'wysiwyg_editor',
'keyColumn' => 'name',
),
'is_domain' => 1,
'is_contact' => 0,
Expand Down

0 comments on commit 5862ef4

Please sign in to comment.