-
-
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
Fix issue 6904 by removing the subclass parameter from model auto complete #7851
Fix issue 6904 by removing the subclass parameter from model auto complete #7851
Conversation
b1a4467
to
b0955d4
Compare
@VincentLanglet Ready to review. The automation test are just checking that a subclass value is not there,. I don't think I can do more than this. |
Best would be a functional test to reproduce the issue from #6904. Do you think it would be possible ? |
The issue is base on the fact that the subclass parameter is present when
we are on creation flow with an admin that have subclass calling the model
auto complete endpoint via ajax. Not sure how you would proceed to do that
without a panther setup ?
Just calling the model auto complete endpoint without having a subclass
parameter don't test anything since I didn't change anything other than
removing the parameter in the twig template.
The fix I made for the other issue was to remove/put back the parameter in
the controller but that was a "hack" since we had too many place to check.
The best solution would have been to remove the parameter completely which
the only wau to test would have been to check that the parameter is not
there.
…On Thu., Jun. 23, 2022, 2:46 a.m. Vincent Langlet, ***@***.***> wrote:
The automation test are just checking that a subclass value is not there,.
I don't think I can do more than this.
Best would be a functional test to reproduce the issue from #6904
<#6904>. Do you
think it would be possible ?
—
Reply to this email directly, view it on GitHub
<#7851 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA73OAEPTISR4C737K6EZG3VQQB5HANCNFSM5ZSGWVTA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Does the other fix still needed then ? |
Yes since it's not the same endpoint. Once we found all the subclass parameter that have issues we could revisit how the fix was done. The current one seems to be a "final" fix for that specific use case. |
$subclass = uniqid('subclass'); | ||
$client = static::createClient(); | ||
$crawler = $client->request(Request::METHOD_GET, '/admin/tests/app/foo/create'); | ||
$crawler = $client->request(Request::METHOD_GET, '/admin/tests/app/foo/create?subclass='.$subclass); |
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.
IMHO this should go in a new test instead of modifying this one
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.
Indeed @mpoiriert, two tests are better than one
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.
Done
b0955d4
to
3ace714
Compare
3ace714
to
3acf85f
Compare
Thanks @mpoiriert |
Hello, |
@Geekimo The issue is the way the subclass have been implemented. |
@mpoiriert Our admin class can edit two entities inheriting from the same abstract entity. We found out by going back to the latest version before your fix that the |
@Geekimo To make sure I understand you were already making a "hook" since the behaviour wasn't suppose to accomplish what you were trying to do ? |
@mpoiriert AFAIK there wasn't any hook. |
Not sure if I follow correctly the conversation. Something broke after this PR? |
It's not the same endpoint. So yes. Once we found all the subclass
parameter that have issues we could revisit how the fix was done. I'll
check this later and let you know.
…On Thu., Jun. 23, 2022, 4:49 a.m. Vincent Langlet, ***@***.***> wrote:
The fix I made for the other issue was to remove/put back the parameter in
the controller but that was a "hack" since we had too many place to check.
The best solution would have been to remove the parameter completely which
the only wau to test would have been to check that the parameter is not
there.
Does the other fix still needed then ?
—
Reply to this email directly, view it on GitHub
<#7851 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA73OAEJGZIZ45HR4QA53IDVQQQJBANCNFSM5ZSGWVTA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@mpoiriert any news regarding this bug ? I have the same issue. Abstract entity and discriminator map. I need to pass subclass parameter manually via req_params: |
@ENDaZONELT The issue was that subclass should not be passed automatically. I don't know your exact use case but the one that I fix was because AdminA (wiht subclass) -> Calling AutoComplete of AdminB was not working because the subclass of admin A was pass to AdminB. |
…
Subject
I am targeting this branch, because the bug was introduce here.
Closes #6904.
Changelog
### Fixed Model Auto Complete failing in create flow of admin with subclasses