-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 SQL alias generation regression for simple inheritance #8329
Conversation
Test case is also needed |
This fixes a regression from 099c5b4. Without the fix, "where part" in SQL is generated with incorrect aliases. See doctrine#8229 (comment).
Have you checked the checkbox yet? |
f7a19db
to
57d7212
Compare
I have cleaned up git history, removed unnecessary try catch in a test, unnecessary usage of If you plan to push some more commits, you need to pull with rebase your branch: |
Thanks, |
yes |
Thanks @rogregoire! FYI: I just found two other untested use cases for which my #8229 fix doesn't work yet. I'm currently trying to create tests for it and will provide a PR soon. |
Thanks! Ping me in a PR afterwads |
@ostrolucky After some testing everything works fine. The problem was an outdated composer.lock file not matching the composer.json file and pointing to an old version. |
👍 |
@cziegenberg can you please explain your use case? This looks like invalid mapping to me. But maybe I am wrong, are these two entities stored in one or two distinct tables in your case? I am pretty sure this fails in many other places that only check for |
@rogregoire The ResolveEntityTargetListener does not work when you extend another entity with. Its specifically for implementing an interface. Your use-case of Entity1 extends Entity0 is only supported if you do Inheritence Mapping. |
This isn't my PR, so do you really mean my usecase? My use case is explained in #8229. The goal is a "everything is a resource"-structure:
A mapped super class wouldn't allow to reference "any type of resource", right? |
…octrine#8329)" This reverts commit f4ebded.
* [GH-8229] Prevent AttributeOverride on fields from entities, only allowed for MappedSuperclass * [GH-8229] Prevent AssociationOverride on fields from entities, only allowed for MappedSuperclass * Revert "Fix SQL alias generation regression for simple inheritance (#8329)" This reverts commit f4ebded. * [GH-8229] Finalize checks for illegal attribute/assocation overrides. * [GH-8229] Revert ccae8f7 PR #8234 * [GH-8229] Update documentation to clarify only mapped superclass or trait works with overrides * [GH-8229] Fix style violations introduced by revert * [GH-8229] Fix style violations introduced by revert * [GH-8229] Temporarily disable the exception until 2.8. * Make phpcs happy
As asked by @ostrolucky in the #8229 issue - I'm created a PR trying to fix a edge case of what I think may be a regression in the effort of supporting Joined table inheritance with AttributeOverride.
Context:
Proposal:
Excluding INHERITANCE_TYPE_NONE entities to use inherited classname as parameter for getSQLTableAlias generation in BasicEntityPersister::getSelectConditionStatementSQL
As said in original comment, I'm really not sure of what I'm doing, I'm new to doctrine 2
Referenced Issue comments: #8229 (comment)