Skip to content
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 SchemaValidator with abstract child class in discriminator map - Enforcing Abstract Entity in DiscriminatorMap is important for some operations #9262

Conversation

olsavmic
Copy link
Contributor

Resolves #9142

Recent fix introduced in 2.10.2 9096: Fix SchemaValidator with abstract child class in discriminator map is a regression to the SchemaValidator as having all @entity classes, including those that are non-instantiable (abstract) is important for some operation.

This reverts commit bbb68d0.

#9145 demonstrates that even abstract classes are required to be present in discriminator map.

@beberlei beberlei merged commit 5bf8140 into doctrine:2.10.x Dec 18, 2021
@beberlei beberlei added this to the 2.10.4 milestone Dec 18, 2021
@derrabus derrabus changed the title Draft: Fix SchemaValidator with abstract child class in discriminator map - Enforcing Abstract Entity in DiscriminatorMap is important for some operations Fix SchemaValidator with abstract child class in discriminator map - Enforcing Abstract Entity in DiscriminatorMap is important for some operations Dec 18, 2021
derrabus added a commit that referenced this pull request Dec 20, 2021
* Docs: consistency for FQCN, spacing, etc (#9232)

* Docs: consistent spacing, consistent array-style, consistent FQCN, avoid double escaped slashes, avoid double quotes if not necessary

* Docs: use special note block instead of markdown-based style

* Docs: Quote FQCN in table with backticks to be compatible with all render engines

* Drop all mentions API doc - it is not available anymore

* Add missed FQCN for code snippets

* Revert "Fix SchemaValidator with abstract child class in discriminator map (#9096)" (#9262)

This reverts commit bbb68d0.

* [docs] Fix wording for attributes=>parameters. (#9265)

Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
Co-authored-by: olsavmic <molsavsky1@gmail.com>
Co-authored-by: Benjamin Eberlei <kontakt@beberlei.de>
@BenMorel
Copy link
Contributor

@beberlei Shouldn't we work on making it work without the abstract classes in the discriminator map, rather than accepting this limitation?

@olsavmic
Copy link
Contributor Author

olsavmic commented Dec 22, 2021

@BenMorel This PR did not change the existing behaviour in any way, it's just fixing the validator so that it now validates what's actually required. This issue is resolved now.

Making it work with abstract classes in the discriminator map is a different question and it's a feature/improvement which deserves its own issue & eventually PR. I'd love to make/see such contribution but I don't know how to overcome the limitation mentioned in #9142 (comment)

Btw I actually wanted to integrate the test cases from #9145 to this PR so that the issue is not reintroduced in the future, that's why I marked it as Draft. Thanks for merging anyway, I may do this in separately

derrabus added a commit to derrabus/orm that referenced this pull request Dec 26, 2021
* 2.11.x:
  Enable UnusedUse sniff again (doctrine#9267)
  Whitelist composer plugins used by this repository (doctrine#9286)
  Fix XML export for `change-tracking-policy` (doctrine#9285)
  Allow symfony/cache 6 (doctrine#9283)
  Put actual value instead of index inside $originalEntityData. (doctrine#9244)
  Fix return types of cache interfaces (doctrine#9271)
  Better explain limitations of DQL "DELETE" (doctrine#9281)
  Fix docblocks on nullable EM properties (doctrine#9273)
  Docs: use canonical order for phpdoc tags, add missed semicolon (doctrine#9190)
  Make PrimaryReadReplicaConnection enforcement explicit (doctrine#9239)
  Regenerate Psalm baseline (doctrine#9272)
  Improve compatibility with Doctrine DBAL 4 (doctrine#9266)
  [docs] Fix wording for attributes=>parameters. (doctrine#9265)
  Support for nesting attributes with PHP 8.1 (doctrine#9241)
  Revert "Fix SchemaValidator with abstract child class in discriminator map (doctrine#9096)" (doctrine#9262)
  Docs: consistency for FQCN, spacing, etc (doctrine#9232)
@mpdude
Copy link
Contributor

mpdude commented Jan 17, 2023

Since #10411 has been merged, it should be safe to re-apply the changes from #9095.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforcing Abstract Entity in DiscriminatorMap is important for some operations
5 participants