You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If the entity has a foreign identifier (for example @Id property is also a @OneToOne relation) - selectors in the generated DQL should be formatted with IDENTITY(alias.identifier) instead of just alias as FilterEagerLoadingExtension does now.
How to reproduce
Create an entity that has a property that is identifier and a relation at the same time.
Request will fail with the following error: [Semantical Error] line 0, col 76 near 'o IN(SELECT o_a2': Error: Invalid PathExpression. Must be a StateFieldPathExpression
Possible Solution FilterEagerLoadingExtension should check if the entity contains foreign identifier & if it does - format selectors differently.
Pull request with a proposed fix will be submitted shortly.
The text was updated successfully, but these errors were encountered:
Edvinas9
added a commit
to Edvinas9/core
that referenced
this issue
Feb 9, 2021
…#4042)
* Issue #4041 bugfix: FilterEagerLoadingExtension foreign identifier handling
* test: add a unit test and use a foreign id for DummyCar
* chore: add changelog entry
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
API Platform version(s) affected: 2.6.0
Description
If the entity has a foreign identifier (for example
@Id
property is also a@OneToOne
relation) - selectors in the generated DQL should be formatted withIDENTITY(alias.identifier)
instead of justalias
as FilterEagerLoadingExtension does now.How to reproduce
@ApiResource
)@SearchFilter
to some another subpropertyRequest will fail with the following error:
[Semantical Error] line 0, col 76 near 'o IN(SELECT o_a2': Error: Invalid PathExpression. Must be a StateFieldPathExpression
Possible Solution
FilterEagerLoadingExtension should check if the entity contains foreign identifier & if it does - format selectors differently.
Pull request with a proposed fix will be submitted shortly.
The text was updated successfully, but these errors were encountered: