mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
ReflectionEnumProperty throws error on AttributeReader::getPropertyAnnotations() #6911
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 @ezkimo on GitHub (Jan 14, 2022).
Originally assigned to: @beberlei on GitHub.
Bug Report
Summary
An Error "Internal error: Failed to retrieve the reflection object" is thrown when calling
AttributeReader::getPropertyAnotationsbecause the inherited functionReflectionProperty::getAttributes()is not called on the original reflection property in theReflectionEnumPropertyclass.In my specific case I 'm using custom annotations I have to read for custom behaviour. When trying to retrieve the custom annotations the error occurs.
Current behavior
When trying to fetch all or a specific annotation of an entity property, the call fails with an error "Internal error: Failed to retrieve the reflection object".
How to reproduce
Expected behavior
The expected behaviour should return the property attributes like
ReflectionProperty::getAttributes()is supposed to. A possible solution could be extending theReflectionEnumPropertyclass with an inheritedgetAttributesmethod, that will return the attributes from the original reflection property.