-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
added error-response when running request with XHR #5710
added error-response when running request with XHR #5710
Conversation
Please describe the current behavior. Do we currently return an empty response? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding error-response for XHR requests
Please describe the current behavior. Do we currently return an empty response?
Updated description
Do you think people might currently be relying on that kind of HTML? |
@greg0ire I think it’s possible but only as part of workaround for this inconsistent behavior. |
Maybe we should apply your fix only when the client sends an Accept header that requests |
a95f9a2
@greg0ire @core23 @OskarStark I've done what @greg0ire suggested above, I've done same for success result. |
Thansk @oleg-andreyev |
This PR causes an issue with SonataPageBundle since this bundle uses the CRUDController and does all edit with ajax requests. Everytime validation fail on a block edit, an error flash message is added (contrary to before). Then all those messages are displayed at once on the next page the user visits. What can we do about this? |
Can you share a screenshot? |
Subject
Adding error-response for XHR requests
Current behaviour: when submitting form with AJAX (XHR) and if error occurs HTML will be returned instead of JSON.
I am targeting this branch, because features (BC?)
Changelog
### Changed Added JSON response from edit/create action when form is invalid.
To do