Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293211

Create BC redirects for children of changed paths

$
0
0

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,

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

  1. Install Drupal 10.1.x with the Standard or Umami profile.
  2. Visit the path /admin/structure/block/block-content/types/manage/basic/permissions
  3. 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

  1. 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.
  2. Update existing redirects to use the new helper class.
  3. Add a BC route for entity.block_content_type.edit_form, since that is the Field UI base path.
  4. 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


Viewing all articles
Browse latest Browse all 293211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>