PathAliasListBuilder doesn't support translated paths in the alias links

Created on 30 May 2023, over 1 year ago

Problem/Motivation

When viewing the admin/config/search/path and filtered on an alias path that is used by multiple translations of the source node. The alias column in the table will display the same path node/{NID} for all 3 translated pieces of content. Instead it should link out to each translated node.

Steps to reproduce

  1. Create a content type with some fields that supports content translations.
  2. Create an English node.
  3. Create a translated node (ja) that is linked to this English content. (they share the same nid)
  4. Go to admin/config/search/path and search for the alias path.
  5. You will see two alias paths come up in the table and each language en and ja will show in the table.
  6. However, the "Alias" column links will be set to node/NID, Which will link to the English or site default language. Not to each translated piece of content.

If you look at the attached screenshot. You can see that in this example there are 3 translated pieces of content. However, the first one in the table is language 'Japanese' it the Alias link is set to node/NID.

This should be set to something like /ja/security/vulnerabilities/L1TF.

Proposed resolution

Class: PathAliasListBuilder

Needs to support the translation of the entity while executing buildRow()

    $url = Url::fromUserInput($path, [
      'language' => $entity->language(),
    ]);
πŸ› Bug report
Status

Needs work

Version

9.5

Component
PathΒ  β†’

Last updated 4 days ago

  • Maintained by
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡ΊπŸ‡ΈUnited States Dan Kolbas

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024