function Image::validateConfigurationForm
Form validation handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides PluginFormInterface::validateConfigurationForm
File
- 
              core/
modules/ ckeditor5/ src/ Plugin/ CKEditor5Plugin/ Image.php, line 64  
Class
- Image
 - CKEditor 5 Image plugin.
 
Namespace
Drupal\ckeditor5\Plugin\CKEditor5PluginCode
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  $form_state->setValue('status', (bool) $form_state->getValue('status'));
  $directory = $form_state->getValue([
    'directory',
  ]);
  $form_state->setValue([
    'directory',
  ], trim($directory) === '' ? NULL : $directory);
  $max_size = $form_state->getValue([
    'max_size',
  ]);
  $form_state->setValue([
    'max_size',
  ], trim($max_size) === '' ? NULL : $max_size);
  $max_width = $form_state->getValue([
    'max_dimensions',
    'width',
  ]);
  $form_state->setValue([
    'max_dimensions',
    'width',
  ], trim($max_width) === '' ? NULL : (int) $max_width);
  $max_height = $form_state->getValue([
    'max_dimensions',
    'height',
  ]);
  $form_state->setValue([
    'max_dimensions',
    'height',
  ], trim($max_height) === '' ? NULL : (int) $max_height);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.