diff -u b/src/Form/ImceEditorImageDialog.php b/src/Form/ImceEditorImageDialog.php --- b/src/Form/ImceEditorImageDialog.php +++ b/src/Form/ImceEditorImageDialog.php @@ -3,6 +3,7 @@ namespace Drupal\imce\Form; use Drupal\Core\Form\FormStateInterface; +use Drupal\editor\Entity\Editor; use Drupal\editor\EditorInterface; use Drupal\editor\Form\EditorImageDialog; @@ -14,16 +15,15 @@ /** * {@inheritdoc} * - * @param \Drupal\editor\EditorInterface $editor + * @param \Drupal\editor\Entity\Editor $editor * The text editor to which this dialog corresponds. */ - public function buildForm(array $form, FormStateInterface $form_state, EditorInterface $editor = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, Editor $editor = NULL) { $form = parent::buildForm($form, $form_state, $editor); // Disable image upload field if editor uses ImceImage button. if ($this->imceImagePluginAvailable($editor) && isset($form['fid'])) { - $form['fid']['#disabled'] = TRUE; - $form['fid']['#wrapper_attributes']['class'][] = 'visually-hidden'; + $form['fid']['#access'] = FALSE; } return $form;