Loading core/modules/editor/editor.module +1 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ function editor_form_filter_admin_format_editor_configure($form, FormStateInterf if ($editor_value !== NULL) { if ($editor_value === '') { $form_state->set('editor', FALSE); $form_state->set('editor_plugin', NULL); } elseif (empty($editor) || $editor_value !== $editor->getEditor()) { $format = $form_state->getFormObject()->getEntity(); Loading core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php +24 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ class EditorAdminTest extends WebDriverTestBase { */ protected static $modules = [ 'ckeditor', 'ckeditor5', ]; /** Loading Loading @@ -66,4 +67,27 @@ public function testEditorSelection() { $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor-toolbar-group-buttons')); } /** * Tests that editor creation works fine while switching text editor field. * * The order in which the different editors are selected is significant, * because the form state must change accordingly. * @see https://www.drupal.org/project/drupal/issues/3230829 */ public function testEditorCreation() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); $this->drupalGet('/admin/config/content/formats/add'); $page->fillField('name', $this->randomString()); $page->selectFieldOption('editor[editor]', 'ckeditor5'); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor5-toolbar-available__buttons')); $page->selectFieldOption('editor[editor]', ''); $assert_session->elementNotExists('css', 'ul.ckeditor-toolbar-group-buttons'); $page->selectFieldOption('editor[editor]', 'ckeditor'); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor-toolbar-group-buttons')); } } Loading
core/modules/editor/editor.module +1 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ function editor_form_filter_admin_format_editor_configure($form, FormStateInterf if ($editor_value !== NULL) { if ($editor_value === '') { $form_state->set('editor', FALSE); $form_state->set('editor_plugin', NULL); } elseif (empty($editor) || $editor_value !== $editor->getEditor()) { $format = $form_state->getFormObject()->getEntity(); Loading
core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php +24 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ class EditorAdminTest extends WebDriverTestBase { */ protected static $modules = [ 'ckeditor', 'ckeditor5', ]; /** Loading Loading @@ -66,4 +67,27 @@ public function testEditorSelection() { $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor-toolbar-group-buttons')); } /** * Tests that editor creation works fine while switching text editor field. * * The order in which the different editors are selected is significant, * because the form state must change accordingly. * @see https://www.drupal.org/project/drupal/issues/3230829 */ public function testEditorCreation() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); $this->drupalGet('/admin/config/content/formats/add'); $page->fillField('name', $this->randomString()); $page->selectFieldOption('editor[editor]', 'ckeditor5'); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor5-toolbar-available__buttons')); $page->selectFieldOption('editor[editor]', ''); $assert_session->elementNotExists('css', 'ul.ckeditor-toolbar-group-buttons'); $page->selectFieldOption('editor[editor]', 'ckeditor'); $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', 'ul.ckeditor-toolbar-group-buttons')); } }