[PP-2] Remove route renames and aliases for block_content

Created on 7 July 2025, 10 days ago

Problem/Motivation

In 📌 Remove BlockContentController::Add Needs work we are doing 2 things to keep BC for existing routes:

1. In BlockContentRouteProvider and BlockContentTypeRouteProvider we rename the routes from what DefaultHtmlRouteProvider::getRoutes generates, and replace them with the existing route names. We do this rather than aliasing since we can't safely alias routes yet until 📌 Add an API for comparing the (current) route name that takes into account deprecated routes Active is done

2. We alias the route names that would have been generated in DefaultHtmlRouteProvider::getRoutes to the existing routes. This gets around the following 2 issues:
- In EntityController::addPage there is a hardcoded URL generated using 'entity.' . $bundle_entity_type->id() . '.add_form' which is rendered when there are no bundles. Aliasing entity.block_content_type.add_form</ code> to <code>block_content.type_add fixes that.
- There are Link headers generated by the rest module that seem to only be generated if the route names match exactly what we'd expect from an entity's link template. See https://git.drupalcode.org/issue/drupal-3346394/-/jobs/5796109 for an example

Steps to reproduce

N/A

Proposed resolution

Remove BlockContentRouteProvider::getRoutes
Remove BlockContentTypeRouteProvider::getRoutes (or the class entirely if it's still only doing the route rename)
Reverse the aliases in block_content.routing.yml so the old routes are aliased to the new routes.

Remaining tasks

Postponed on 📌 Remove BlockContentController::Add Needs work
Postponed on 📌 Add an API for comparing the (current) route name that takes into account deprecated routes Active

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

block_content.module

Created by

🇦🇺Australia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024