You are here

protected function DropzoneJsEbWidget::clearFormValues in DropzoneJS 8.2

Same name and namespace in other branches
  1. 8 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 343

Class

DropzoneJsEbWidget
Provides an Entity Browser widget that uploads new files.

Namespace

Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget

Code

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',
  ], []);
}