Views URL alias don't consider sub-directory and path prefix

Created on 14 February 2020, almost 5 years ago
Updated 22 March 2024, 8 months ago

Problem/Motivation

URL aliases stored in views_url_alias_node table on node create/update are incorrect on below cases.

  • Drupal site has a sub-directory
    e.g. https://YOUR.DOMAIN.COM/{sub_dir}/node/{nid}
  • Entity translation is enabled and site has path prefix
    e.g. https://YOUR.DOMAIN.COM/{lang_code}/node/{nid}

expected values

/something/url/alias

actual values

/{sub_dir}/{lang_code}/something/url/alias

Proposed resolution

Get URL alias with \Drupal\Core\Path\AliasManager on node create/update.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡―πŸ‡΅Japan ueshiy

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024