function CKEditor::submitConfigurationForm

Same name in other branches
  1. 9 core/modules/ckeditor/src/Plugin/Editor/CKEditor.php \Drupal\ckeditor\Plugin\Editor\CKEditor::submitConfigurationForm()

Overrides EditorBase::submitConfigurationForm

File

core/modules/ckeditor/src/Plugin/Editor/CKEditor.php, line 260

Class

CKEditor
Defines a CKEditor-based text editor for Drupal.

Namespace

Drupal\ckeditor\Plugin\Editor

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    // The rows key is not built into the form structure, so decode the button
    // groups data into this new key and remove the button_groups key.
    $form_state->setValue([
        'toolbar',
        'rows',
    ], json_decode($form_state->getValue([
        'toolbar',
        'button_groups',
    ]), TRUE));
    $form_state->unsetValue([
        'toolbar',
        'button_groups',
    ]);
    // Remove the plugin settings' vertical tabs state; no need to save that.
    if ($form_state->hasValue('plugins')) {
        $form_state->unsetValue('plugin_settings');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.