protected function DropzoneJsEbWidget::clearFormValues in DropzoneJS 8
Same name and namespace in other branches
- 8.2 modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php \Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget::clearFormValues()
Clear values from upload form element.
Parameters
array $element: Upload form element.
\Drupal\Core\Form\FormStateInterface $form_state: Form state object.
3 calls to DropzoneJsEbWidget::clearFormValues()
- DropzoneJsEbWidget::submit in modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ DropzoneJsEbWidget.php - InlineEntityFormMediaWidget::clearFormValues in modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ InlineEntityFormMediaWidget.php - Clear values from upload form element.
- MediaEntityDropzoneJsEbWidget::submit in modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ MediaEntityDropzoneJsEbWidget.php
1 method overrides DropzoneJsEbWidget::clearFormValues()
- InlineEntityFormMediaWidget::clearFormValues in modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ InlineEntityFormMediaWidget.php - Clear values from upload form element.
File
- modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ DropzoneJsEbWidget.php, line 311
Class
- DropzoneJsEbWidget
- Provides an Entity Browser widget that uploads new files.
Namespace
Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\WidgetCode
protected function clearFormValues(array &$element, FormStateInterface $form_state) {
// We propagated entities to the other parts of the system. We can now
// remove them from our values.
$form_state
->setValueForElement($element['upload']['uploaded_files'], '');
NestedArray::setValue($form_state
->getUserInput(), $element['upload']['uploaded_files']['#parents'], '');
$form_state
->set([
'dropzonejs',
$this
->uuid(),
'files',
], []);
}