protected function FileUploadForm::buildEntityFormElement in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::buildEntityFormElement()
- 9 core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::buildEntityFormElement()
File
- core/
modules/ media_library/ src/ Form/ FileUploadForm.php, line 258
Class
- FileUploadForm
- Creates a form to create media entities from uploaded files.
Namespace
Drupal\media_library\FormCode
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;
}