CKEDITOR disables the Firefox spell checker (red squigglies) by default. It does not do this in Chrome and Opera.
The better behavior, especially since the SCAYT spellchecker is now off by default, is to allow the red squigglies, since the native spell checker can be utilized by doing ctrl-right-click to bypass the CKEDITOR right-click menu and get the alternate spellings menu.
This is the same issue as http://drupal.org/node/627180 but for CKEDITOR.
I tried unsuccessfully to modify this behavior with a module. The following code in a module does not work for me:
[code]
/**
* Implementation of hook_wysiwyg_editor_settings_alter().
*/
function ckeditor_config_wysiwyg_editor_settings_alter(&$settings, &$context) {
if($context['profile']->editor == 'ckeditor') {
$settings['disableNativeSpellChecker'] = FALSE;
}
}
[/code]
As a workaround, I hacked the wysiwyg module wysiwyg/editors/ckeditor.inc:
[code]
function wysiwyg_ckeditor_settings($editor, $config, $theme) {
$settings = array(
'baseHref' => $GLOBALS['base_url'] . '/',
'width' => '100%',
// For better compatibility with smaller textareas.
'resize_minWidth' => 450,
'height' => 420,
// @todo Do not use skins as themes and add separate skin handling.
'theme' => 'default',
'skin' => !empty($theme) ? $theme : 'kama',
// By default, CKEditor converts most characters into HTML entities. Since
// it does not support a custom definition, but Drupal supports Unicode, we
// disable at least the additional character sets. CKEditor always converts
// XML default characters '&', '<', '>'.
// @todo Check whether completely disabling ProcessHTMLEntities is an option.
'entities_latin' => FALSE,
'entities_greek' => FALSE,
'disableNativeSpellChecker' => FALSE,
);
[/code]
I can't diagnose why the module approach does not work, and hopefully the future versions will implement advanced configuration.
Thanks.
Comments
Comment #1
brianmercer commentedI figured out why my module doesn't work. It's a PHP 5.3 issue with wysiwyg_editor_settings_alter:
Warning: Parameter 2 to ckeditor_config_wysiwyg_editor_settings_alter() expected to be a reference, value given in drupal_alter()Temporary workaround: change &$context to $context
The module code should work as is for folks on PHP 5.2.
Comment #2
twodYes, that's right. The second parameter, $context, isn't passed by reference since the context of the editor isn't supposed to be possible to alter, only the settings generated based on that context. So your workaround isn't really a workaround, but how the hook's function signature is intended to look like. ;)