CON-1221 - Form condition validation issue when used in conjunction with FileUpload FieldType

Created by Gideon Brett 30 Nov 2016, 19:24:26 Updated by Warren Buckley 05 Jul 2018, 12:39:33

What did you do? Created a form with a fileupload field, multiple mandatory fields and a dropdownlist with conditionals that show/hide fields based on values selected. Submitted form after choosing conditional option where original mandatory field is hidden with no value inside that input.

What did you expect to happen? Form to submit and for record data to be stored in database + file uploaded to umbraco media folder

What actually happened? Yellow screen occurred with error log (stack trace attached in error-log.txt)

What version of Umbraco are you using? 7.5.3

What version of Umbraco Forms or Contour are you using? 4.3.3 but the issue occurs in 4.4.0 as well

2 Attachments

Download broken form.zip

Download error-log.txt

Comments

Lars-Erik Aabech 01 Dec 2016, 08:54:12

The reason for this is that the upload field is saved and restored as an IEnumerable in the temporary state in a hidden field. (RecordState or ModelState?) While when converted from a DB record, a Dictionary is created, and that's what's expected in the upload view.


Greg B 24 May 2017, 14:03:50

This is still occuring in Umbraco 7.6.1 and Forms 6.0.1.

The IEnumerable being returned is file location to app_data\temp and can't be used in front end.

Any solution yet?


James Cooper 25 Aug 2017, 14:43:26

I noticed this same behavior on Umbraco Cloud. The issue I noticed is in /Views/Partials/Forms/Fieldtypes/FieldType.FileUpload.cshtml. This code breaks whenever the if statement executes because Model.Values does not contain a dictionary object. It contains a string. It also causes the form to break when traversing form pages. To recreate, just upload a file, traverse to a new form page, and then come back.


Joshua Stewart 23 Feb 2018, 20:27:07

Bump. This issue needs to be fixed.


Eelco Duinsbergen 05 Apr 2018, 10:54:26

This issue is still current in Umbraco Forms 6.0.5. and I think priority should be raised to major as it cripples core functionality of Umbraco Forms.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty:

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.4.0, 6.0.5, 7.0.3

Due in version: 7.0.4

Sprint: Sprint 88

Story Points: 1

Cycle: