Improve redirect logic for usage links in warning messages

Created on 20 September 2024, 3 months ago

Problem/Motivation

Warning message helps users to determine where the entity being edited/deleted is being used and gives the opportunity to check it before performing the action.

By default, this link redirects to /admin/content/entity-usage/{entity_type}/{entity_id}. This is a generic list filtered by the the given entity. However, the entity context is lost for the site administrator.

Given that exists the possibility to add the entity usage local task to certain entity types (/node/{entity_id}/usage or /taxonomy/term/{taxonomy_term_id}/usage), would be great to redirect directly to that page instead of the generic view. That would allow editors to maintain the entity context and perform directly other entity related actions.

Steps to reproduce

  1. Configure Entity Usage to track references to taxonomy term types
  2. Enable the local task and warning messages for taxonomy terms
  3. Create Terms and reference them from other entities
  4. Try to delete the term and see the warning message
  5. Link in the warning message redirects to /admin/content/entity-usage/{entity_type}/{entity_id} instead of /taxonomy/term/{taxonomy_term_id}/usage

Proposed resolution

Redirect the user to the generic list page or the local action depending on the Entity Usage settings.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain plopesc Valladolid

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024