Problem/Motivation

When viewing the Redirect Audit dashboard at /admin/config/search/redirect/audit, the "Target Path" column displays URLs with the current UI language prefix instead of the redirect's actual configured language.

For example:

  • A redirect configured with German (de-de) language pointing to node/650021
  • Expected display: /de-de/glutenfreier-alltag (German alias)
  • Actual display: /en-int/lifestyle (current UI language alias)

This is misleading for administrators trying to audit redirect chains, as the displayed paths don't reflect the actual redirect behaviour.

This issue mirrors a similar problem in the redirect module itself:

Steps to reproduce

  1. Create a multilingual Drupal site with at least two languages (e.g., English and German)
  2. Create a node with translations in both languages, each having different path aliases
  3. Create a redirect chain where the redirect entity has a specific language (e.g., German)
  4. Run the Redirect Audit scan
  5. View the audit results at /admin/config/search/redirect/audit
  6. Observe that the "Target Path" column shows the alias in the current UI language instead of the redirect's configured language

Proposed resolution

  1. For the Target Path column:
    • Extract the internal system path using Url::getInternalPath() (e.g., node/650021)
    • Use AliasManagerInterface::getAliasByPath() with the redirect's language code to get the correct translated alias
  2. Apply the same fix to intermediate links in chain display
  3. Source Path should remain as stored (matching redirect module behavior)

Remaining tasks

  • Review and test the proposed changes
  • Ensure external URLs are handled correctly (displayed as-is)

User interface changes

The Redirect Audit dashboard table at /admin/config/search/redirect/audit will have:

  • Updated "Target Path" column displaying the correct language-specific alias
  • Updated intermediate links showing correct language-specific aliases

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#4 target_translated.png24.92 KBeduardo morales alberti
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

Status: Active » Needs review
StatusFileSize
new24.92 KB

Ready to review:
Target url translated

antonio nunez made their first commit to this issue’s fork.

antonio nunez’s picture

Status: Needs review » Fixed

After reviewing the reported issue and the proposed solution, the implementation appears to be correct.

The changes will be included in the next release. Thank you, Eduardo.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.