public function FileUpload::validate in Lightning Media 8.2
Same name and namespace in other branches
- 8.4 src/Plugin/EntityBrowser/Widget/FileUpload.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\FileUpload::validate()
- 8 src/Plugin/EntityBrowser/Widget/FileUpload.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\FileUpload::validate()
- 8.3 src/Plugin/EntityBrowser/Widget/FileUpload.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\FileUpload::validate()
Overrides EntityFormProxy::validate
File
- src/
Plugin/ EntityBrowser/ Widget/ FileUpload.php, line 89
Class
- FileUpload
- An Entity Browser widget for creating media entities from uploaded files.
Namespace
Drupal\lightning_media\Plugin\EntityBrowser\WidgetCode
public function validate(array &$form, FormStateInterface $form_state) {
$value = $this
->getInputValue($form_state);
if ($value) {
parent::validate($form, $form_state);
}
else {
$form_state
->setError($form['widget'], $this
->t('You must upload a file.'));
}
}