diff --git a/core/modules/editor/editor.api.php b/core/modules/editor/editor.api.php index 7c965e5..3063c0e 100644 --- a/core/modules/editor/editor.api.php +++ b/core/modules/editor/editor.api.php @@ -93,12 +93,10 @@ function hook_editor_default_settings_alter(&$default_settings, $editor) { * @param array $settings * All the settings that will be added to the page via drupal_add_js() for * the text formats to which a user has access. - * @param array $formats - * The list of format objects for which settings are being added. */ -function hook_editor_js_settings_alter(array &$settings, array $formats) { - if (isset($formats['basic_html'])) { - $settings['editor']['formats']['basic_html']['editor'][] = 'MyDifferentEditor'; +function hook_editor_js_settings_alter(array &$settings) { + if (isset($settings['editor']['formats']['basic_html'])) { + $settings['editor']['formats']['basic_html']['editor'] = 'MyDifferentEditor'; $settings['editor']['formats']['basic_html']['editorSettings']['buttons'] = array('strong', 'italic', 'underline'); } } diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php index 2e82585..4ae77b6 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php @@ -95,7 +95,7 @@ public function getAttachments(array $format_ids) { ); } - // We have all JavaScript settings, allow other modules to alter them. + // Allow other modules to alter all JavaScript settings. drupal_alter('editor_js_settings', $settings); if (empty($attachments['library']) && empty($settings)) { diff --git a/core/modules/editor/tests/modules/editor_test.module b/core/modules/editor/tests/modules/editor_test.module index fc2d748..6a0a30f 100644 --- a/core/modules/editor/tests/modules/editor_test.module +++ b/core/modules/editor/tests/modules/editor_test.module @@ -35,7 +35,7 @@ function editor_test_editor_js_settings_alter(&$settings) { return; } - if (isset($settings['full_html'])) { - $settings['full_html']['editorSettings']['ponyModeEnabled'] = FALSE; + if (isset($settings['editor']['formats']['full_html'])) { + $settings['editor']['formats']['full_html']['editorSettings']['ponyModeEnabled'] = FALSE; } }