Skip to content

Restore namingStrategy and typedFieldMapper on ClassMetadata wakeup - #12785

Open
akasakariko wants to merge 1 commit into
doctrine:3.9.xfrom
akasakariko:fix/12783-restore-naming-strategy-and-typed-field-mapper
Open

akasakariko wants to merge 1 commit into
doctrine:3.9.xfrom
akasakariko:fix/12783-restore-naming-strategy-and-typed-field-mapper

Conversation

@akasakariko

Copy link
Copy Markdown

Fixes #12783

Summary

  • Restore namingStrategy and typedFieldMapper from Configuration in ClassMetadataFactory::wakeupReflection() so custom implementations are preserved after metadata cache unserialization without serializing potentially non-serializable services
  • Fall back to DefaultNamingStrategy and DefaultTypedFieldMapper in ClassMetadata::wakeupReflection() when those properties are uninitialized
  • Remove readonly from ClassMetadata::$typedFieldMapper so it can be restored consistently alongside $namingStrategy
  • Add regression tests in tests/Tests/ORM/Mapping/ClassMetadataTest.php and tests/Tests/ORM/Mapping/ClassMetadataFactoryTest.php

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Note

Greptile reviews are for Doctrine maintainers as a first filter, do not start fixing all the issues immediately unless you think they make sense. A maintainer will give you a green light on this PR for further development or rejection.

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Restores mapping services after metadata is read from cache.

  • Cached metadata keeps using the configured naming and field-type rules.

No actionable issues found. Tests were not run.

Reviews (1) · Last reviewed commit: "Restore namingStrategy and typedFieldMap..." · Reviewed by Greptile

@GromNaN
GromNaN changed the base branch from 3.7.x to 3.8.x November 14, 2026 13:51
@greg0ire
greg0ire changed the base branch from 3.8.x to 3.9.x November 14, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClassMetadata: namingStrategy and typedFieldMapper are not restored after metadata cache unserialization

1 participant