Skip to content

EasyCorp/EasyAdminBundle

4.x
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

…stmored)

This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Allow searching by associated fields with the same name

This little change handles the case when we have custom search fields defined in CRUD configuration, but each pointing to a field with the same name. Example taken from my daily project:

Entity `Department` has (among others) 2 associations - `City` and `Company`. In CRUD I'd like to easily search by department name and both company name and city name, so:
`->setSearchFields(['id', 'name', 'city.name', 'company.name'])`

The way it's done in `EntityRepository` makes it only search by `company.name`, as field name is taken as the key for search fields configuration. I moved the field name to a property and return a list from `getSearchablePropertiesConfig()` to mitigate the issue.

This time around I was able to work with tests - I have extended `BlogPost` fixture to include optional publisher association and then search by both `author` and `publisher`. It fails without this little change and works as expected after.

Commits
-------

903abf1 Allow searching by associated fields with the same name
ff0d9ff

Git stats

Files

Permalink
Failed to load latest commit information.

EasyAdmin

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.

EasyAdmin, a fast, beautiful and modern admin generator for Symfony applications

Installation

EasyAdmin 4 requires PHP 8.0.2 or higher and Symfony 5.4 or higher. Run the following command to install it in your application:

$ composer require easycorp/easyadmin-bundle

Documentation

Versions

Repository Branch EasyAdmin Version Symfony Compatibility PHP Compatibility Status Docs
4.x 4.x 5.4, and 6.x 8.0.2 or higher New features and bug fixes Read Docs
3.x 3.x 4.4, and 5.x 7.2.5 or higher Bug fixes only; no new features Read Docs
2.x 2.x 4.x, and 5.x 7.1.3 or higher No longer maintained Read Docs
1.x 1.x 2.x, 3.x and 4.x 5.3.0 or higher No longer maintained -

Demo Application

easyadmin-demo is a complete Symfony application that showcases EasyAdmin features. It's based on the Symfony Demo project.

License

This software is published under the MIT License