Skip to content

[Filter] Unable to use EntityFilter on nested accociations #7452

@KDederichs

Description

@KDederichs

Describe the bug
Currently when you try to use the Entity filter on nested associations you'll get:

An error has occurred resolving the options of the form "Symfony\Bridge\Doctrine\Form\Type\EntityType": The required option "class" is missing.

This was partially fixed by #7295 though like I pointed out in there it breaks the Configurator.

With the new association filter changes I'm not sure how compatible that PR is though cause there seem to be conflicts.

To Reproduce

class Foo {
    #[OneToMany(targetEntity: Bar::class)]
    private Bar $bar;
}

class Bar {
    #[OneToMany(targetEntity: Baz::class)]
    private Baz $bar;
}

class Baz {
   #[Column]
   private string $name;
}

In the Foo Crud Controller configure the filter like:

    public function configureFilters(Filters $filters): Filters
    {
        return $filters->add(EntityFilter::new('bar.baz', 'Baz'))
    }

(OPTIONAL) Additional context
If they are useful, include logs, code samples, screenshots, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions