EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Filters : fields not mapped is not working

Open wehostadm opened this issue 1 year ago • 2 comments

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,

wehostadm avatar Jul 26 '24 13:07 wehostadm

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

HeyIAmBob avatar Sep 18 '24 20:09 HeyIAmBob

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,

wehostadm avatar Sep 20 '24 16:09 wehostadm