mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Hydration not working for Embeddables with php 7.4 typed properties #6324
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sspat on GitHub (Oct 7, 2019).
Bug Report
Summary
There is an error when using php 7.4 and trying to fetch an entity from the database that has typed properties containing value objects that are mapped as embeddables.
Current behavior
There is a fatal error.
How to reproduce
Expected behavior
The entity should be fetched from the database and hydrated.
@Ocramius commented on GitHub (Oct 8, 2019):
@sspat can you isolate this into a test case? I think we'll need to add overhead to
ReflectionEmbeddedPropertyso that it checks whether the property was initialized (new PHP 7.4 API)@sspat commented on GitHub (Oct 8, 2019):
@Ocramius Added the testcase, can I be of any further assistance on this issue?
@SenseException commented on GitHub (Oct 10, 2019):
@sspat Do you like to add a fix for the failing test?
@sspat commented on GitHub (Oct 10, 2019):
@SenseException Could you explain please, what did you mean? The test failing on <=7.3, or the fix for the bug itself? Thanks
@sspat commented on GitHub (Oct 14, 2019):
@lcobucci @SenseException moved the test entity to a separate file, all tests passing now on <=7.3
@SenseException commented on GitHub (Oct 17, 2019):
The fix of the bug itself. :-) Thank you for your work.
@ansien commented on GitHub (Nov 29, 2019):
Any updates on this issue?
@SenseException commented on GitHub (Dec 2, 2019):
Updates can be found in the corresponding PR #7857.
@internalsystemerror commented on GitHub (Dec 18, 2019):
The solution "appears" to be simple. In ReflectionEmbeddedProperty.php change line 89:
to
I've tried to read as much of the open issues/PR/history on this matter and it appears that the solution will be to create a ReflectionEmbeddedProperty74 class which is used instead for PHP 7,4? Tests appear to be written in the PR mentioned above.
Am I missing anything? I'm happy to contribute or wait, whichever is required. Performance implications were implied however, I'm unable to find these.
@shadowhand commented on GitHub (Jan 17, 2020):
Per https://github.com/doctrine/orm/pull/7857#issuecomment-575537801, I believe this is fixed in
doctrine/persistence.