-
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
Clearing the em before accessing an uninitialized relation results in "typed property must not be accessed before initialization..." error #10336
Comments
I have the same exception, but thrown in my tests when a method is called on a proxied object. The proxied object is returned via the referenceRepository of LiipTestFixturesBundle
|
I have probably similar problem in tests using the referenceRepository of LiipTestFixturesBundle. I call method which should return a string (field of an entity) but it returns null. While debugging found that in older version of this lib in method \Doctrine\ORM\UnitOfWork::createEntity the condition |
Same problem here since 2.14: createEntity ignores the existing proxy object (specified in the hint) and returns a new one instead. As result, the proxy object stays uninitialized. Results eventually in same error message as the title of this issue. |
Thanks for the reproducer. I will definitely have a look, just not before the 9th. |
The bug is caused by the removal of those three lines. After adding them again the test succeeds and none fails (in PHP 7.4 environment). |
I have faced with the same issue and can confirm that reverting those lines fixed the issue in my case. |
BC Break Report
Summary
Consider the following code:
Previous behavior
In 2.13.5, would echo the relation's value property.
Current behavior
In 2.14.0:
@nicolas-grekas, could this be related to #10187?
Reproducer: #10337
The text was updated successfully, but these errors were encountered: