Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

"Export to CSV" breaks if a form is submitted after the hosted page node is unpublished (Umbraco v7.15) #163

Open
TFAstudio opened this issue Nov 25, 2019 · 1 comment

Comments

@TFAstudio
Copy link

TFAstudio commented Nov 25, 2019

If you load a web page with a form and that node is then unpublished whilst you still have it open, the form can still be submitted. The experience for the user is adequate as they see the thank-you message and the record is passed to the data handlers without an issue.

However, we have discovered the record is saved to the database with two NULL references:

  • URL
  • PageID

When we try to export via the back office using the Formulate > Submissions > Export to CSV feature, it fails.

"System.NullRefereceException"
<StackTrace>
at CsvHelper.CsvWriter.WriteField[T](T field) at formulate.app.Controllers.StoredDataDownloadController.GenerateCsvOfFormSubmissions(Form form) at formulate.app.Controllers.StoredDataDownloadController.DownloadCsvExport(GetCsvExportRequest request) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescripto....

The NULL references in the JSON data are the cause.

Valid record:

97986    123DBBD2-BCFA-410E-AFFE-20D6BC216aaa         2019-11-25 01:04:41.447               CFC1A6B7-B65C-4499-8CDF-E77BA550Eccc   [
  {
    "FieldId": "c81939123bae452b9e75de0530cc1bbb",
    "FieldName": "Referral",
    "Value": "Official Website"
  }
]              []             /applications/          1335

Breaking record:

97987    3DD3A390-3E22-428D-B223-D2FFBAF5Dyyy         2019-11-25 01:04:29.370               CFC1A6B7-B65C-4499-8CDF-E77BA550Eccc   [
  {
    "FieldId": "c81939123bae452b9e75de0530cc1bbb",
    "FieldName": "Referral",
    "Value": "Friend is staff"
  }
]              []             NULL     NULL
@Nicholas-Westby
Copy link
Contributor

Thanks for this detailed report.

I have a few priorities ahead of this, but when I get to this I'll make sure to have the export work with null values.

If you would like to submit a PR, that would also be welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants