-
-
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
remove subclass parameter when generating sonata_admin_short_object_information #7845
remove subclass parameter when generating sonata_admin_short_object_information #7845
Conversation
@VincentLanglet This is something that would work and it's really specific to the bug I have found. I would rewrite the url generation of that specific url in a macro since it's getting bigger and noisy. |
This seems nice.
|
@VincentLanglet I have add another way to solve this. It may be a bit less clean from a coding point of view but it's safer (if someone generate the url from somewhere), easier to test (just need to make a unit test for the action) and maintain (the action is aware of it's behaviour and no one else need to). I have add back the query parameter just so the request is still intact at the end but this could be optional and just removing the parameter would be enough. |
@VincentLanglet I have add another way to solve this. It may be a bit less clean from a coding point of view but it's safer (if someone generate the url from somewhere), easier to test (just need to make a unit test for the action) and maintain (the action is aware of it's behaviour and no one else need to). I have add back the query parameter just so the request is still intact at the end but this could be optional and just removing the parameter would be enough. I prefer the second option, what do you think ? |
So you just need to remove the subclass before
? (And the filter could be removed ?) This is not easy to understand and would require some comments I think. |
Yes the filter could be removed.
Or course I'll add comment.
Not sure exactly where. I think the solution I have done with removing the subclass parameter in the action/controller that have conflict with would be the best way to do (and keep it that way). This make sure that we don't need to bother how the url get generated. Other wise we would need to add the filter in the first solution every where we need it and we will never be sure someone does not generate the url somewhere else without the filter. I don't know which controller would need this so I don't know where to remove the subclass and this is probably where the NEXT_MAJOR would be. |
Let's go with this solution then |
ca0fcab
to
c0e9eb3
Compare
@VincentLanglet I added the automation test and some comment near the code for the developer. Should be ready |
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.
Good for now. For next major we should try to reduce parameters sent to methods to the minimum needed.
I'll wait for #7819 to release |
…
I am targeting this branch, because bug is present in this branch.
Closes #7843.
Changelog
### Fixed Fix the subclass query parameter conflict in the sonata.admin.action.get_short_object_description controller.
To do