Skip to content

Wrong alias replacement in FilterEagerLoadingExtension #2763

Description

@juffin-halli

Method ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension::getQueryBuilderWithNewAliases uses simple str_replace($aliases, $replacements, (string) $wherePart). So if i have embedded object in my entity being serialized it`s alias could be replaced.
For exampe: entity have embedded object in property "seo" and field expression would be "o.seo.slug". Using standard alias "o" the code produces "o_a2.seo_a2.slug" expression.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions