-
-
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
Add correct accept header to ajaxSubmit to prevent 406 error #6222
Conversation
75e66d6
to
3704d47
Compare
Could you please rebase your PR and fix merge conflicts? |
The test are failing, I am working on that. |
19e7991
to
3fcc75a
Compare
3fcc75a
to
ca3d5c3
Compare
I have changed the solution strategy for this probleem, to a simpler solution. |
@jordisala1991 Yes I have tried that, but is not working correctly in all versions. See https://travis-ci.org/github/sonata-project/SonataAdminBundle/jobs/711372401 What do you think of the new solution with Javascript. In this solution there is no PHP changes needed. |
That could be a problem with phpunit-brdige 5.1.0 🤔 I like the new solution with only js changes, just wondering if someone in some case can still end up with that problem because of the restriction on php |
The problem related to |
I think we should make both changes:
|
You said you were getting a 406, yet the code in the controller does not produce a 406 yet, it will only do so in next major. Please link to the piece of code you get a 406 from (use the profiler to find the controller that is involved, etc.) |
Yes the 406 is produced in the master branch, I have switched the base branch. The 3.x branch only triggers a deprecation. |
.idea files should not commited. @sonata-project/contributors Shouldn't we add this in |
d912e76
to
9ab1546
Compare
Yeah I added the .idea folder by mistake :-( It's now untracked |
I really don't like the idea (:trollface:) to track every possible IDE configuration path or other residual files which are related to the specific environment or the operating system. |
fc95c52
9ab1546
to
fc95c52
Compare
fc95c52
to
8f7c365
Compare
Thanks @nieuwenhuisen ! |
Ref #5710 (comment) This commit broke SonataPageBundle a little more. SonataPageBundle uses the CRUDController and does all edit with ajax requests with the |
See #6250 |
Add correct accept header to ajaxSubmit to prevent 406 error
The modeltype save request gives a 406 (Not acceptable) error in my browser. This is causes because my browser sends an wildcard Accept header
*/*
and the code checks on an exact match ofapplication/json
. To fix this I set the accept header before the ajax request.I am targeting this branch, because the deprecation is introduce in 3.x and the error is given in the master branch.
Changelog