Skip to content
Snippets Groups Projects
Commit 21543387 authored by Rakhi Soni's avatar Rakhi Soni Committed by Edouard Cunibil
Browse files

Issue #3293519 by Rakhi Soni, sourabhjain, DuaelFr: fix Drupal Coding Standards

parent 34fc8b17
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,11 @@ function editor_file_upload_settings_form(Editor $editor) {
'#title' => t('Allowed file extensions'),
'#default_value' => $extensions,
'#description' => t('Separate extensions with a space or comma and do not include the leading dot.'),
'#element_validate' => [['\Drupal\file\Plugin\Field\FieldType\FileItem', 'validateExtensions']],
'#element_validate' => [
[
'\Drupal\file\Plugin\Field\FieldType\FileItem', 'validateExtensions',
],
],
'#maxlength' => 256,
// By making this field required, we prevent a potential security issue
// that would allow files of any type to be uploaded.
......
......@@ -153,7 +153,7 @@ class EditorFileDialog extends FormBase implements BaseFormIdInterface {
$form['attributes']['href'] = [
'#title' => $this->t('URL'),
'#type' => 'textfield',
'#default_value' => isset($file_element['href']) ? $file_element['href'] : '',
'#default_value' => $file_element['href'] ?: '',
'#maxlength' => 2048,
'#required' => TRUE,
];
......
......@@ -67,7 +67,9 @@ class DrupalFile extends CKEditorPluginBase implements CKEditorPluginConfigurabl
$form_state->loadInclude('editor_file', 'admin.inc');
$form['file_upload'] = editor_file_upload_settings_form($editor);
$form['file_upload']['#attached']['library'][] = 'editor_file/drupal.ckeditor.drupalfile.admin';
$form['file_upload']['#element_validate'][] = [$this, 'validateFileUploadSettings'];
$form['file_upload']['#element_validate'][] = [
$this, 'validateFileUploadSettings',
];
return $form;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment