Steps to reproduce:

1. Create a webform with draft feature activated
2. Create a radios element with 2 options and setup as required
4. Create a document file element
5. Visit the form and upload a file
6. Save it as a draft
7. Try to remove file (see webform_error.png attached)

This is source (YAML), also an entire configuration is provided

radios_test:
  '#type': radios
  '#title': 'Radios test'
  '#options':
    10: '10'
    20: '20'
  '#required': true
document_test:
  '#type': document_file
  '#title': 'Document Test'

Comments

javivf created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new936 bytes

So this issue is a little tricky. The issue is that 'Save Draft' is saving NULL values, which are being converted to empty string, and an empty string is not a valid #default_value for radio buttons #options.

Status: Needs review » Needs work

The last submitted patch, 2: cannot_delete_files-2864729-2.patch, failed testing.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB

Testing a totally different solution.

Status: Needs review » Needs work

The last submitted patch, 4: cannot_delete_files-2864729-4.patch, failed testing.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB

  • jrockowitz committed cf2f08e on 8.x-5.x
    Issue #2864729 by jrockowitz, javivf: Cannot delete files from draft...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

javivf’s picture

Done! it works :) Should I change status to Closed(fixed)?

jrockowitz’s picture

The status will be automatically changed to 'Closed' in 2 weeks.

Status: Fixed » Closed (fixed)

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