Skip to content

[Live] Lower the normalizer priority of DoctrineObjectNormalizer and fix embeddables #453

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

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

kbond
Copy link
Member

@kbond kbond commented Sep 8, 2022

Q A
Bug fix? yes
New feature? no
Tickets Fix #452
License MIT

Changed from 100 to -100, we want a user's entity normalizers to run before. We also want DoctrineObjectNormalizer to run before the default object normalizer.

Tests added to cover the following ways object properties on a component are normalized:

  • entity with no custom normalizer (uses DoctrineObjectNormalizer)
  • entity with custom normalizer
  • dto with custom normalizer
  • dto with no custom normalizer (uses the default object normalizer)
  • entity with embeddable (mapped using annotations)
  • entity with embeddable (mapped using xml)
  • dto with embeddable (mapped using annotations)
  • dto with embeddable (mapped using xml)

Changed from 100 to -100, we want a user's entity normalizers to run
before. We also want `DoctrineObjectNormalizer` to run before the
default object normalizer.
@kbond kbond force-pushed the normalize-objects branch from 6ad9aec to d295fa8 Compare September 9, 2022 15:52
/**
* Ensure the $class is not embedded or a mapped superclass.
*/
private static function ensureManagedObject(ObjectManager $om, string $class): ?ObjectManager
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #452 (comment) for why this is needed.

@kbond kbond changed the title [Live] Lower the normalizer priority of DoctrineObjectNormalizer [Live] Lower the normalizer priority of DoctrineObjectNormalizer and fix embeddables Sep 9, 2022
@weaverryan
Copy link
Member

Thanks Kevin!

@weaverryan weaverryan merged commit b2441fa into symfony:2.x Sep 16, 2022
@benr77
Copy link

benr77 commented Sep 17, 2022

Yes - thanks for your efforts Kevin.

@weaverryan Do you know when you are likely to tag a release with these changes? Thanks.

@kbond kbond deleted the normalize-objects branch September 17, 2022 15:59
@weaverryan
Copy link
Member

Not sure - maybe a week or two - I have some other changes I'd like to get in first - but typically we're releasing monthly, and it's nearly been a month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Live Component] DoctrineObjectNormalizer is being used to normalize my non-Doctrine object
3 participants