FormBuilderInterface::AJAX_FORM_REQUEST => TRUE,
],
],
];
return $element;
} /**
* {@inheritdoc}
*/
protected function buildEntityFormElement(MediaInterface
$media, array
$form, FormStateInterface
$form_state,
$delta) { $element = parent::
buildEntityFormElement($media,
$form,
$form_state,
$delta);
$source_field =
$this->
getSourceFieldName($media->bundle->entity
);
if (isset($element['fields'
][$source_field])) { $element['fields'
][$source_field]['widget'
][0
]['#process'
][] =
[static::
class, 'hideExtraSourceFieldComponents'
];
} return $element;
} /**
* Processes an image or file source field element.
*
* @param array $element
* The entity form source field element.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current form state.
* @param $form
* The complete form.
*
* @return array
* The processed form element.
*/