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.
Bug found and patched by @ksom
Since 3008228, the Doctrine Bridge's PropertyInfo Extractor tries to extract the type of the key in an indexed association. However, as you can see in 3008228#diff-7a8fb8072d57f95ea6e37898b05895bcR91, the extractor was using the metadata of the class containing the association instead of the target entity's metadata to retrieve the type of the index.
The tests were green because in 3008228#diff-c7e914ed89ceffd939733efe08c039c2R44, the property used to
indexBy
was present in the classes on both sides of the relation with the same type.Once the test is fixed (by renaming the property in the targetEntity), the test provided at 3008228#diff-1b2e044d1df011c00caf802a07895bdbR88 gives the error
The fix is to fetch the metadata of the target entity and check there for the property type.