test(doctrine): uninitialized typed properties in PersistProcessor#7736
Open
test(doctrine): uninitialized typed properties in PersistProcessor#7736
Conversation
Co-authored-by: soyuka <1321971+soyuka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix uninitialized typed properties in PersistProcessor
Fix fatal error on uninitialized typed properties in PersistProcessor
Feb 6, 2026
soyuka
approved these changes
Feb 6, 2026
Co-authored-by: soyuka <1321971+soyuka@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Fix fatal error on uninitialized typed properties in PersistProcessor
Add functional test for uninitialized typed properties in PersistProcessor
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a functional test to verify the fix for issue #7735, which was already implemented in PR #7738. The fix prevents fatal errors when
PersistProcessor::handleLazyObjectRelations()attempts to access uninitialized typed properties in entities that use Doctrine lifecycle callbacks.Background
PersistProcessor::handleLazyObjectRelations()was callingReflectionProperty::getValue()without checking initialization state, causing fatal errors when entities use typed properties initialized in Doctrine lifecycle callbacks. This occurs beforepersist()executes, so@PrePersistcallbacks haven't run yet.The fix (adding an
isInitialized()guard beforegetValue()) was merged in PR #7738.Changes
Issue7735Testwith entity using typed property initialized in@PrePersistIssue7735EntityandIssue7735Resourceusing ObjectMapperExample
Previously this crashed with "Typed property must not be accessed before initialization". Now the property is skipped until after persistence when it's initialized.
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.