function MediaTypeForm::submitForm
Same name in other branches
- 8.9.x core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::submitForm()
- 10 core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::submitForm()
- 11.x core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::submitForm()
Overrides EntityForm::submitForm
File
-
core/
modules/ media/ src/ MediaTypeForm.php, line 296
Class
- MediaTypeForm
- Form controller for media type forms.
Namespace
Drupal\mediaCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state->setValue('field_map', array_filter($form_state->getValue('field_map', []), function ($item) {
return $item != MediaSourceInterface::METADATA_FIELD_EMPTY;
}));
parent::submitForm($form, $form_state);
$this->entity
->setQueueThumbnailDownloadsStatus((bool) $form_state->getValue([
'options',
'queue_thumbnail_downloads',
]))
->setStatus((bool) $form_state->getValue([
'options',
'status',
]))
->setNewRevision((bool) $form_state->getValue([
'options',
'new_revision',
]));
if (isset($form['source_dependent']['source_configuration'])) {
// Let the selected plugin save its settings.
$this->entity
->getSource()
->submitConfigurationForm($form['source_dependent']['source_configuration'], $this->getSourceSubFormState($form, $form_state));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.