By tstoeckler on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.2.x
Issue links:
Description:
Custom entity types will be automatically provided with a collection route given the following circumstances:
- They provide a
collectionlink - They provide a list builder
- They provide an administrative permission
- They use or extend core's
DefaultHtmlRouteProvideras a route provider
The following excerpt of an example entity type annotation satisfies all the conditions, for example:
/**
* @ContentEntityType(
* ...
* label = @Translation("Awesome thingy"),
* handlers = {
* "list_builder" = "Drupal\Core\Entity\EntityListBuilder",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* admin_permission = "administer my awesome entities",
* links = {
* "collection" = "/admin/structure/awesomesauce",
* ...
* },
* )
*/
Note that routes with route names of the form entity.$entity_type_id.collection will not be overridden if they are provided in a *.routing.yml file, for example, even if all of the conditions above are met.
Impacts:
Module developers