-
-
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
Make handle xml http request response protected #6214
Make handle xml http request response protected #6214
Conversation
c0e09d4
to
32d793b
Compare
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.
These changes could not be considered BC, since the classes extending CRUDController
could have registered the same methods with different signatures or with lower visibilities than protected.
Oke, I have changed the base branch to master |
Could you please rebase your PR and fix merge conflicts? |
e07a76e
to
ac27a77
Compare
I kinda disagree. If you consider this as a BC-break, every new function is a BC-break because we can use the same argument (if a class extend and register the function with différent signature or lower visibility...). For instance, in https://github.com/sonata-project/SonataAdminBundle/pull/6108/files#diff-97179c4fc4120f802148ade89fc48508R342 we could have said the same. This can be merged on 3.x IMHO. |
I think technically both changes can lead to the same result, but the difference is here we are changing the visibility of an existing method. |
This does not make a real difference to me, we're not suppose to guess the name of the method created by the users. It's more important especially since we're trying to close the Api for the next major. |
I am not sure. Do I need to change anything to this PR? |
For me, this PR can be merge on 3.x. For @phansys, it can't be. |
The BC promise we are following is this one: https://symfony.com/doc/current/contributing/code/bc.html#changing-classes Same as Symfony (which is really restrictive), and we are sometimes making exceptions (like commands)... About this change: Private methods About the need: IMO we should not open more the API. We are focusing on master on closing as much as possible. In conclusion: If I have to vote on the BC topic, it is allowed (Symfony is allowing it), but for me we shouldn't open more the api right now. |
I am looking for an extension point for these methodes. protected function preHandleXmlHttpRequestSuccessResponse(Request $request, $object): JsonResponse
{
}
private function handleXmlHttpRequestSuccessResponse(Request $request, $object): JsonResponse
{
$preResponse = $this->preHandleXmlHttpRequestSuccessResponse($request, $object);
if (null !== $preResponse) {
return $preResponse;
}
...
} Or is there a better extension point? |
Maybe it is not super nice, but in this case, can't you override the renderJson method? or it is private too? |
I would say that we're trying to close if possible. If someone wants to use our code, with good reason, I think she should always provide an easy way to do it. In which way you want to override BTW, you can finally change the branch to |
ac27a77
to
cd76a11
Compare
I have changed the branch to 3.x
I want to add an extra field with the full html render of the form. This makes it easy to fully replace the form with the correct error's visible. We need AJAX for this because we want to update a couple form at the same time. |
Could you please rebase your PR and fix merge conflicts? |
31a091e
to
cf4c346
Compare
Can you please rebase, otherwise the CI system won't run and we can't merge your changes @nieuwenhuisen |
Forcing the pipeline tasks to be executed again. |
cf4c346
to
93273bf
Compare
Are you still interested in this PR @nieuwenhuisen ? |
Yes, I will do a rebase this week |
93273bf
to
0ad5420
Compare
4937d3d
to
401c113
Compare
…rorResponse deprecation message.
ff1a986
to
b876d2f
Compare
b876d2f
to
8add8b1
Compare
8add8b1
to
0e66165
Compare
Thanks @nieuwenhuisen |
Hi @nieuwenhuisen, can you give an example about how you override the method. |
Subject
Change the visibility of the CRUDController methodes
handleXmlHttpRequestSuccessResponse
andhandleXmlHttpRequestErrorResponse
from private to protected to allow overriding.In my application I want to extend the Xml Http response, but there is no way to override it. The only option is to override the editAction but that's not desirable.
I am targeting this branch, because the change is not backwards compatible.
Changelog