Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.1]fn configureCrud() $crud->setFilters() #4406

Open
aegladkikh opened this issue May 26, 2021 · 3 comments
Open

[3.3.1]fn configureCrud() $crud->setFilters() #4406

aegladkikh opened this issue May 26, 2021 · 3 comments

Comments

@aegladkikh
Copy link

Hi, i try to use this:

public function configureCrud(Crud $crud): Crud
{
return $crud
->setFilters([])
->setPaginatorPageSize(30);
}

the setFilters function takes an array or null as arguments.

in the code of the function itself, $ this-> dto-> setFiltersConfig ($ filters) is called;

and here $ filters should be FilterConfigDto $ filterConfig

from here I get the type mismatch execution.

Log:

EasyCorp\Bundle\EasyAdminBundle\Dto\CrudDto::setFiltersConfig(): Argument #1 ($filterConfig) must be of type EasyCorp\Bundle\EasyAdminBundle\Dto\FilterConfigDto, array given, called in /app/vendor/easycorp/easyadmin-bundle/src/Config/Crud.php on line 227

@Julen10
Copy link

Julen10 commented May 27, 2021

Have you tried using configureFilters function?

public function configureFilters(Filters $filters): Filters
    {
        return $filters
            ->add('title')
            ->add('price')
            ->add('published')
        ;
    }

@aegladkikh
Copy link
Author

Okay I will try

@Dallas62
Copy link
Contributor

Hi,
I can confirm there is a typing issue:
image
From master via Github:
image
https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Config/Crud.php#L234
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants