public function MediaBundleForm::validateForm in Media entity 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
MediaBundleForm.php, line 291
Class
- MediaBundleForm
- Form controller for node type forms.
Namespace
Drupal\media_entityCode
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
// Let the selected plugin validate its settings.
$plugin = $this->entity
->getType()
->getPluginId();
$plugin_configuration = !empty($this->configurableInstances[$plugin]['plugin_config']) ? $this->configurableInstances[$plugin]['plugin_config'] : [];
$instance = $this->mediaTypeManager
->createInstance($plugin, $plugin_configuration);
$instance
->validateConfigurationForm($form, $form_state);
}