diff -u b/core/modules/ckeditor/config/schema/ckeditor.schema.yml b/core/modules/ckeditor/config/schema/ckeditor.schema.yml --- b/core/modules/ckeditor/config/schema/ckeditor.schema.yml +++ b/core/modules/ckeditor/config/schema/ckeditor.schema.yml @@ -45,4 +44,0 @@ -# Plugin \Drupal\ckeditor\Plugin\ckeditor\plugin\Language -ckeditor.plugin.language: - type: string - label: 'Language list type' diff -u b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php --- b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php @@ -54,8 +54,13 @@ */ public function getConfig(Editor $editor) { $language_list = array(); + $config = array('list_type' => 'un'); $settings = $editor->getSettings(); - $predefined_languages = ($settings['plugins']['language']['list_type'] == 'all') ? + if (isset($settings['plugins']['language'])) { + $config = $settings['plugins']['language']; + } + + $predefined_languages = ($config['list_type'] == 'all') ? LanguageManager::getStandardLanguageList() : LanguageManager::getUnitedNationsLanguageList(); @@ -94,7 +99,11 @@ * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) { + $config = array('list_type' => 'un'); $settings = $editor->getSettings(); + if (isset($settings['plugins']['language'])) { + $config = $settings['plugins']['language']; + } $predefined_languages = LanguageManager::getStandardLanguageList(); $form['list_type'] = array( @@ -105,7 +114,7 @@ 'un' => t('United Nations subset'), 'all' => t('All @count languages', array('@count' => sizeof($predefined_languages))), ), - '#default_value' => $settings['plugins']['language']['list_type'], + '#default_value' => $config['list_type'], '#description' => t('The list of languages to show in the language dropdown. The basic list will only show the six official languages of the UN. The extended list will show all @count languages that are available in Drupal.', array( '@url' => Url::fromUri('http://www.un.org/en/aboutun/languages.shtml/'), '@count' => sizeof($predefined_languages), diff -u b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php --- b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php +++ b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php @@ -7,8 +7,6 @@ /** * @coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\Language - * - * @group Foo */ class LanguageTest extends UnitTestCase { only in patch2: unchanged: --- a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php @@ -125,11 +125,11 @@ function testExistingFormat() { // Ensure an Editor object exists now, with the proper settings. $expected_settings = $expected_default_settings; + $expected_settings['plugins']['language']['list_type'] = 'un'; $expected_settings['plugins']['stylescombo']['styles'] = ''; $editor = entity_load('editor', 'filtered_html'); $this->assertTrue($editor instanceof Editor, 'An Editor config entity exists now.'); $this->assertIdentical($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.'); - // Configure the Styles plugin, and ensure the updated settings are saved. $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $edit = array( @@ -241,6 +241,7 @@ function testNewFormat() { // Ensure an Editor object exists now, with the proper settings. $expected_settings = $default_settings; + $expected_settings['plugins']['language']['list_type'] = 'un'; $expected_settings['plugins']['stylescombo']['styles'] = ''; $editor = entity_load('editor', 'amazing_format'); $this->assertTrue($editor instanceof Editor, 'An Editor config entity exists now.');