Filters : fields not mapped is not working
Describe the bug This documentation says that we need to set mapped to false https://symfony.com/bundles/EasyAdminBundle/current/filters.html
but it is not working, we have an exception :
The "XXX" field does not exist in the "App\Entity\YYY" entity.
How to fix it ?
Thanks,
Hi @wehostadm, I'm facing the same problem as you.
Did you find out how to do it ?
Or is the "mapped" option deprecated ?
Step to reproduce : In a controller that extends AbstractCrudController
class FooCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return Foo::class;
}
public function configureFilters(Filters $filters): Filters
{
return $filters
->add(TextFilter::new('customTextFilter')->setFormTypeOption('mapped', false));
}
// ...
}
Exception thrown
The "test" field does not exist in the "App\Entity\Foo" entity
Versions
easycorp/easyadmin-bundle : 4.12.0
symfony/form : 6.1.11
Last info : "mapped" option on forms outside easyadmin filters works like a charm
Thanks
Hi @HeyIAmBob
Unfortunately, I did not have any solution for this and I think the mapped option is depreciated. Maybe @javiereguiluz can help us ?
Thanks,