timw255 / timw255.Sitefinity.SuperForms

MIT License
4 stars 3 forks source link

Null object reference with a File Upload widget in a SuperForms form. #3

Open DevoGH opened 8 years ago

DevoGH commented 8 years ago

Hi, we added SuperForms to our Sitefinity 8.1.5822.0 development environment. Our testing found that adding a File Upload widget to a SuperForms form and attempting to upload a file produces the error "Object reference not set to an instance of an object." on line 420 of LogicalFormsControl.cs. The GetMethod call on that line returns null (SaveFiles argument). It appears that something changed in the FormsControl class.

Thanks!

PS - Is there a way to look into the FormsControl class to view its methods?

ognotongo commented 8 years ago

This appears that the Invoke method on line 420 needs to pass an empty string instead of null:

.Invoke(null, new object[] { value as UploadedFileCollection, manager, description, userHostAddress, formFieldControl.MetaField.FieldName });

to

.Invoke("", new object[] { value as UploadedFileCollection, manager, description, userHostAddress, formFieldControl.MetaField.FieldName });

This got it working for me.

tim-layton commented 5 years ago

@DevoGH @ognotongo @timw255 I noticed you said that you got it working on 8.1 we are trying to get this working on 11. Did you have to do anything or modify anything to get this working? For some reason it doesn't seem to be validating conditional items under the multiple choices. Just curious if anyone has this working on a newer install of SF? Thanks!