Commit 3c3692c8 authored by catch's avatar catch

Issue #2536880 by alexpott: CKEditor admin form broken

parent d3c33d58
......@@ -157,7 +157,7 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor
'library' => array('ckeditor/drupal.ckeditor.admin'),
'drupalSettings' => [
'ckeditor' => [
'toolbarAdmin' => $this->renderer->renderPlain($ckeditor_settings_toolbar),
'toolbarAdmin' => (string) $this->renderer->renderPlain($ckeditor_settings_toolbar),
],
],
),
......
......@@ -117,6 +117,18 @@ function testExistingFormat() {
$editor = entity_load('editor', 'filtered_html');
$this->assertFalse($editor, 'No Editor config entity exists yet.');
// Ensure that drupalSettings is correct.
$ckeditor_settings_toolbar = array(
'#theme' => 'ckeditor_settings_toolbar',
'#editor' => Editor::create(['editor' => 'ckeditor']),
'#plugins' => $this->container->get('plugin.manager.ckeditor.plugin')->getButtons(),
);
$this->assertEqual(
$this->drupalSettings['ckeditor']['toolbarAdmin'],
$this->container->get('renderer')->renderPlain($ckeditor_settings_toolbar),
'CKEditor toolbar settings are rendered as part of drupalSettings.'
);
// Ensure the toolbar buttons configuration value is initialized to the
// expected default value.
$expected_buttons_value = json_encode($expected_default_settings['toolbar']['rows']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment