dev/core#594 Fix issue where editor_id is expected to be keyed on name not on value
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 27 Dec 2018 21:37:52 +0000 (08:37 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 28 Dec 2018 03:38:43 +0000 (14:38 +1100)
Add in a post upgrade message encourging people to check their editor setting

CRM/Upgrade/Incremental/php/FiveNine.php
api/v3/Setting.php
settings/Core.setting.php

index 1f5f9fef12a0981125fd85363e762d8a067e43ab..a7a84933884e6727ed0973284bfbae84004e8f0b 100644 (file)
@@ -60,7 +60,8 @@ class CRM_Upgrade_Incremental_php_FiveNine extends CRM_Upgrade_Incremental_Base
         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 you altered your WYSIWYG editor setting you should visit the <a %1>Display Preferences</a> page and check the editor setting', array(1 => 'href="' . CRM_Utils_System::url('civicrm/admin/setting/preferences/display', 'reset=1') . '"')) . '</p>';
     }
 
     // Example: Generate a post-upgrade message.
index f9921fa12aabf5f90a23c7d9b9af705a51ef4bfa..29df94b76e9cc0776318f77082bf728f698941ae 100644 (file)
@@ -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'
     );
   }
index afc5566b6d0d9521e51fac6b6b47e6d95c62e0ad..57f299c59863f67cb62788e9f2b3f86ccc1f5f63 100644 (file)
@@ -220,6 +220,7 @@ return array(
     'title' => ts('Wysiwig Editor'),
     'pseudoconstant' => array(
       'optionGroupName' => 'wysiwyg_editor',
+      'keyColumn' => 'name',
     ),
     'is_domain' => 1,
     'is_contact' => 0,