Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save form containing Data Consent after upgrade from V9 #794

Closed
AaronSadlerUK opened this issue Jun 27, 2022 · 9 comments
Closed

Comments

@AaronSadlerUK
Copy link

AaronSadlerUK commented Jun 27, 2022

I have forms in my site which I have upgraded from V9 to V10.
Prior to the upgrade I was able to edit and save forms successfully.

Since the V10 upgrade any forms containing Data Consent fields fail to save, with the following error returned:

)]}',
{"Message":"The request is invalid.","ModelState":{"AllFields[6].PreValues":["The PreValues field is required."],"Pages[0].FieldSets[0].Containers[0].Fields[6].PreValues":["The PreValues field is required."]}}

If I remove all the Data Consent fields and then re-add them to the form, I am able to save the form however any data associated with the previous fields is lost (not ideal with data consent fields!)

@AndyButland
Copy link

Thanks @AaronSadlerUK - I spotted this one myself yesterday (there's an issue here with the nullability constraints added in V10, where for field types that don't have prevalues we expect to an empty array and not null. I've ensured this is the case for the next patch release.

@AndyButland
Copy link

10.0.1, including a fix for this issue, is released now to NuGet .

@AaronSadlerUK
Copy link
Author

@AndyButland sorry to re-open this, but I am still getting the same issue on 10.0.1

@AndyButland
Copy link

Hmm... would you mind just checking please that you don't have something cached (as the fix was in the JavaScript)?

@AaronSadlerUK
Copy link
Author

Which file was changed so I can compare :)

@AndyButland
Copy link

AndyButland commented Jun 28, 2022

umbraco.forms.js - you should find you have the following code, just before a call to formResource.saveWithWorkflows...:

        //ensure we have non-null prevalues
        var formFields = formService.getAllFields($scope.form);
        for (var i = 0; i < formFields.length; i++) {
          if (formFields[i].prevalues == null)
          {
            formFields[i].prevalues = [];
          }
        }

@AaronSadlerUK
Copy link
Author

Yep, it's there

image

@AaronSadlerUK
Copy link
Author

Ha!

I needed to purge the CDN 😅

I wonder why the update didn't bump smidge 🤔

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

No branches or pull requests

3 participants