Problem/Motivation
Noticed this while reviewing #2987964: Move custom block types admin link to admin/structure.
The block_content_type Entity Type does not provide an add link template in its entity type annotation:
* links = {
* "delete-form" = "/admin/structure/block/block-content/manage/{block_content_type}/delete",
* "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}",
* "entity-permissions-form" = "/admin/structure/block/block-content/manage/{block_content_type}/permissions",
* "collection" = "/admin/structure/block/block-content/types",
* },
Currently, the add route is provided in block_content.routing.yml and the route name does not follow the established pattern, block_content.type_add where it should be entity.block_content_type.add.
Proposed resolution
Provide a add link template in the block_content_type entity annotation.
Since block_content_type already uses the AdminHtmlRouteProvider this will automatically generate the entity.block_content_type.add route.
The block_content.type_add route can then be deprecated, this requires #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name to be committed, so postponing on that issue.
Comments
Comment #2
aaronmchaleComment #4
smustgrave commentedShould be addressed in #3346394: Replace BlockContentController::add with EntityController::addPage via the AdminHtmlRouteProvider route provider