EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Search on DQL protected field as association

Open bastoune opened this issue 3 years ago • 0 comments

Describe the bug I am having an entity linked to another which className is "Group". "Group" is Linked to a 3rd entity called "Foo". I want to search in the bar field of Foo. So I do: $crud->setSearchFields(['group.name', 'group.foo.bar']) I am getting the following error :

Error: Identification Variable group used in join path expression but was not defined before.

I can see the logic here beacuse Group is protected by adding ea_ prefix in the DQL (see in the additional context below).

So I tried $crud->setSearchFields(['ea_group.foo.bar'])

But then i get the error The "ea_group" field does not exist

Additional context Here is the original PR that created the ea_ prefix to FIX the initial bug. https://github.com/EasyCorp/EasyAdminBundle/pull/4806/files

bastoune avatar Jun 14 '22 15:06 bastoune