Problem/Motivation
In Drupal 10.1, we are changing paths and menu navigation for several pages in the Block and Block content modules. In particular,
- #2987964: Move custom block types admin link to admin/structure changes
/admin/structure/block/block-content/types
to/admin/structure/block-content
- #2317981: Move block content edit and delete routes under admin/content/block to improve IA for editors and fix breadcrumbs changes
/block/{block_content}
to/admin/content/block-content/{block_content}
.
When we change paths, we provide redirects from the old ones to the new ones. See #3333383: Create a redirect for the new Block types path. That issue and #2317981 create redirects for the primary paths and also for child paths defined in the block_content
module.
This issue is about creating redirect for the child paths provided by other modules, such as content_translation
, config_translation
, and user
. We also want to make it easy for contributed modules to do the same.
Steps to reproduce
- Install Drupal 10.1.x with the Standard or Umami profile.
- Visit the path
/admin/structure/block/block-content/types/manage/basic/permissions
- Admire your site's 404 page.
The expected behavior is to be redirected to the new path, /admin/structure/block-content/manage/basic/permissions
, with warning messages in the messages area and in the logs.
Proposed resolution
- Replace the helper function
redirectWithWarning()
from #3318112: Move "Block layout" from Structure to Appearance with a helper class so that it can be used by other controller classes. - Update existing redirects to use the new helper class.
- Add a BC route for
entity.block_content_type.edit_form
, since that is the Field UI base path. - Use a new route subscriber to add routes to redirect from old child paths to new ones.
Remaining tasks
User interface changes
Redirect to the new path with a warning message instead of giving a 404 (page not found) response.
API changes
Does adding a new helper class count as an API change? Or a new route subscriber?
Data model changes
None