URL generation bug.

Created on 16 December 2024, 6 days ago

Problem/Motivation

I find bug in generation URL. path_alias is giving different results depending on context.

Steps to reproduce

1. Create new content type "Test". Add field "Link".

2. Create node "Test". And enter to field link "/foo". Set alias "/test". Save. Remember system path of your node. In my case it's "/node/7"

3. Go to page /admin/config/search/path
Create alias with system path "/node/7", and alias "/foo".

4. Then try to generate url for this node programmaly. For example with this code.

\Drupal::entityTypeManager()->getStorage('node')->load(7)->toUrl()->toString();

I will do it with hook_preprocess_page.

And add to template '{{ dump(node_url) }}'.

5. Go to the front page and see result.

6. Go to /foo

🐛 Bug report
Status

Active

Version

10.1

Component

path.module

Created by

🇷🇺Russia vokanrak

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