Scenario:

1. Multi-step form with at least 2 pages
2. Save as draft turned on
3. File (or Multiple File) input on sub-page (not on the first page)

Outcome:

After a file is uploaded, when the form is saved as a draft or proceeded to next page (or preview page) the existing submission is duplicated, and the user is now working on the duplicated submission. When the form is submitted, the duplicated submission is saved/submitted. The original submission is left as a draft. When the user views the form again, there is a notification indicating the previous submission, as well as another notification ("A partially-completed form was found. Please complete the remaining portions.") indicating that there is an unfinished copy of the form, please complete all values, yadda yadda. But when the user tries to re-enter values into the previous submission that is still a draft, nothing can be saved to it. The original draft submission must be manually deleted.

I don't know if any of this made sense, but I can easily replicate it on a demo form. I can attach screen shots if needed. Just wondering if anyone else has experienced, or can replicate this behaviour.

Comments

dbthorburn created an issue. See original summary.

thisisnotrealpeople’s picture

Issue summary: View changes
danchadwick’s picture

Issue tags: -multistep, -file, -duplicates

Reproduced. Multiple-file is a red herring. The problem exists with webform core itself.

  1. Text component
  2. page break
  3. File component
  4. Turn on preview and automatic saving of drafts.
  1. Enter text on page one
  2. Click NEXT >
  3. Click Browse and select the file
  4. Click Upload (this is necessary)
  5. Click Preview. The draft is duplicated.

I strongly suspect that this is caused by the core bug with file fields where the ajax call from the Upload button generates a new form build id. If this case, there may not be much we can do about it except hide the upload button with CSS. We currently have this issue with more than one file component on the same page.

Someone needs to confirm the above hypothesis.

danchadwick’s picture

Adding the related issue, but in this case I don't think it is causing this problem.

When the ajax call for the UPLOAD or REMOVE button comes in, the $form_state['values']['details'] is missing. Therefore webform ends up creating yet another draft. The solution is to save the details in storage.

Committed to 7.x-4.x.

  • DanChadwick committed 01c130d on 7.x-4.x
    Issue #2562703 by DanChadwick: Fixed Multistep + File Input = Duplicate...
danchadwick’s picture

Version: 7.x-4.10 » 8.x-4.x-dev
Category: Bug report » Task
Status: Fixed » Patch (to be ported)

Port to D8 needed.

  • fenstrat committed 742effb on 8.x-4.x
    Issue #2562703 by DanChadwick: Fixed Multistep + File Input = Duplicate...
fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Category: Task » Bug report
Status: Patch (to be ported) » Fixed

Committed and pushed to 8.x-4.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.