mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Redis proxy error with inherited id #6345
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 @andrews05 on GitHub (Nov 19, 2019).
Bug Report
Summary
Using Redis cache causes an error when getting proxies for entities with an inherited id or inherited transient property.
Current behavior
The second time a proxy class is requested after its initial generation will cause the following error:
"Call to a member function getProperty() on null in Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php:190"
How to reproduce
doctrine orm:generate-proxies, or anything else that will get the proxy classes.Expected behavior
No error.
Additional information
This issue does not happen on v2.7, or if using Memcached instead.
There's a comment at the line causing the error that says "TODO possible NPE".
@SenseException commented on GitHub (Nov 24, 2019):
The mentioned comments:
99b7d1e9d4/lib/Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php (L170)99b7d1e9d4/lib/Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php (L190)@andrews05 Does this happen because
Childitself doesn't have the annotations despite that a mapped superclass is used?@andrews05 commented on GitHub (Nov 24, 2019):
@SenseException you mean the id annotation? I don’t think you’re allowed to re-declare a field in a subclass, doctrine will complain.
My actual use case is with JTI, where the id is necessarily inherited.