-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] TransformationFailedException with JSON submitted data #31017
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
Comments
Hello @asentner, thank you for opening this issue. I don’t really understand the necessary steps to reproduce. It seems to me that submitting some json means submitting a string that should not break a hidden field submission. How do you handle transformation exactly? |
Yes we should close here. |
Closing as a duplicate then. |
The solution to this issue can be found here: #29809 (comment) Specifically, you need to create & use a new form type that allows you to submit this kind of unstructured data: https://github.com/sulu/SuluArticleBundle/blob/c0ed0b34b2903d517f555811276d0ad7f598497e/Document/Form/UnstructuredType.php#L12-L32 |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 3.4.24 / 4.2.5
Description
TransformationFailedException thrown when JSON is submitted through HiddenType field. I have one form that is passing a JSON which is a canvas map of a captured signature.
This commit creates the breaking change for us:
symfony/form@4f7d286#diff-9c65c1fe9e9fce8398f48544b0bbf2a5
Specifically this block of code:
This runs before a transformer can clean the data and a mapper does not seem to be a good fit for this.
How to reproduce
Submit JSON through a HiddenType form field
Possible Solution
Check for an additional form option scalar = false or something along those lines.
Example JSON:
This can get quite large depending on the size of the complexity of the signature. Transformers and mappers seem to run after this exception is thrown.
Thoughts?
The text was updated successfully, but these errors were encountered: