Skip to content

1.12.0

Compare
Choose a tag to compare
@javiereguiluz javiereguiluz released this 15 Mar 19:41

This version of EasyAdmin includes an important bug fix which could break its backwards compatibility in some edge cases. Depending on your backend configuration, you might need to make some small changes related to the names of the entities.

This error only affects you when defining the backend configuration in several files.

Understanding the problem

Suppose your backend configuration is defined in two different files:

# file1.yml
easy_admin:
    entities:
        Customers:
            class: AppBundle/Entity/User
            # ...

# file2.yml
easy_admin:
    entities:
        Providers:
            class: AppBundle/Entity/User
            # ...

When EasyAdmin imports both files, only the entity names of the file1.yml are maintained. The entity names of file2.yml are lost and they are replaced by numeric keys (0, 1, etc.)

When an entity defines a numeric key, EasyAdmin assigns to it a name based on the entity class. In the above example, the Providers entity name of the file2.yml config is turned into User (if there are other entities named User, a numeric suffix is appended until a unique name is found: User2, User3, etc.).

This means that the backend will contain two entities named Customers and User, instead of the expected Customers and Providers.

Entity names are used as part of the URLs, custom actions and main menu items, so it's very important to maintain the original names assigned by the backend configuration.

The solution

In EasyAdmin 1.12.0 this issue is fixed and everything works as expected when defining the configuration in different files. Your entities will maintain the names you defined in the configuration files.

Backwards compatibility breaks

If you were affected by this issue in the past, you may have configured your backend to use the wrong entity names instead of the entity names you defined. In version 1.12.0 you'll need to make the opposite change. Check out the entity names in:

  • The easy_admin.design.menu option.
  • The methods you may have defined in your own AdminController to customize the behavior of some entities (some of these methods include the name of the entity as part of the method name).