diff --git a/assets/components/clientconfig/js/mgr/sections/home.js b/assets/components/clientconfig/js/mgr/sections/home.js index c57d801..3f00a26 100755 --- a/assets/components/clientconfig/js/mgr/sections/home.js +++ b/assets/components/clientconfig/js/mgr/sections/home.js @@ -115,6 +115,9 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{ if (field.xtype === 'code') { field.height = 150; field.xtype = Ext.ComponentMgr.isRegistered('modx-texteditor') ? 'modx-texteditor' : 'textarea'; + if (MODx.config.which_element_editor == 'Ace') { + Ext.onReady(function() {MODx.ux.Ace.replaceComponent(field.id, 'text/html', 1);}); + } } if (field.xtype === 'richtext') { diff --git a/core/components/clientconfig/processors/mgr/settings/save.class.php b/core/components/clientconfig/processors/mgr/settings/save.class.php index 45e74e4..8244ddd 100644 --- a/core/components/clientconfig/processors/mgr/settings/save.class.php +++ b/core/components/clientconfig/processors/mgr/settings/save.class.php @@ -32,6 +32,11 @@ public function process() { continue; } + // Fix save value for Ace setting + if ($setting->get('xtype') == 'code' && $this->modx->getOption('which_element_editor') == 'Ace') { + $value = $value[1]; + } + if (trim($value) === '' && $setting->get('is_required') && !in_array($setting->get('xtype'), array('checkbox', 'xcheckbox'), true)) { $this->addFieldError($key, $setting->get('label') . ': ' . $this->modx->lexicon('clientconfig.field_is_required'));