If Webform does not validate in submit the uploaded files in dropzone are lost

Created on 27 January 2023, over 1 year ago
Updated 10 March 2023, over 1 year ago

Problem/Motivation

When you have a field validation that fails in Webform that contain Dropzonejs the files uploaded are lost.

Steps to reproduce

Create Webform with Dropzonejs field and some other field,
Try to submit the form with the other field not validating.

Proposed resolution

The files should remain as uploaded.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇮Finland oakulm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @oakulm
  • 🇫🇮Finland oakulm

    Actually this happens when the DOM is refreshed so AJAX request (multi-step forms) etc. will clear the DropzoneJS widget of the files. Files are still submitted with the form.

  • 🇫🇷France superbiche Nantes

    I'm having this issue too, using Webform Cards.
    Dropzone required attribute is not handled with Clientside validation, it doesn't prevent from going to the Preview stage, validation fails, I'm redirected to a custom Webform Cards page with all validation errors.
    There, all files are missing, and if I upload the missing file, every file is in required error (even the one I just uploaded, which can never be validated)

Production build 0.69.0 2024