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

Created on 14 February 2020, over 5 years ago
Updated 29 July 2023, about 2 years 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

2.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.

  • πŸ‡ΊπŸ‡¦Ukraine _shy Ukraine, Lutsk πŸ‡ΊπŸ‡¦
  • Status changed to Needs work about 2 years ago
  • πŸ‡ΊπŸ‡¦Ukraine _shy Ukraine, Lutsk πŸ‡ΊπŸ‡¦

    Please, reroll these changes to the latest module branch - 8.x-2.x.

  • Assigned to paulrad
  • Status changed to Active almost 2 years ago
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡¦Ukraine paulrad

    Tested locally on multi-domain and multilingual site but couldn't reproduce.
    A screenshot from PMA is attached.

  • πŸ‡¨πŸ‡¦Canada dstorozhuk Chicago πŸ‡ΊπŸ‡Έ, Toronto πŸ‡¨πŸ‡¦, Kyiv πŸ‡ΊπŸ‡¦
  • Status changed to Postponed: needs info 3 days ago
  • πŸ‡¬πŸ‡§United Kingdom rachel_norfolk UK

    So, I’m looking at the patch attached and it is trying to update the function views_url_alias_node_node_update() which no longer exists in 3.x

    I don’t think the problem as described still exists in 3.x and, therefore, can be closed. However, I’ll set it to Postponed (needs more info) for the time being and maybe ueshiy can enlighten as to whether they see the problem in 3.x (I don’t, for what it is worth).

    If not, I suggest it is set to Closed (outdated).

Production build 0.71.5 2024