Path alias isn’t validated when a view uses the alias created on a node

Created on 30 August 2025, 11 days ago

Problem/Motivation

When we create a node using node uid we have an option to set a path alias for the node.
Currently the path module only validate if the alias has be used by a node.
But we also have views page that should be validate too. Otherwise the node will be display instead of the views page.

Steps to reproduce

- Install Drupal 11(didn't test in the previous versions).
- Create a new views page.
- Set a path alias for the view like: /news and save the view.
- Access the view by the url drupal-url/news, you should be able to see the view.
- Go to content creation.
- Create any kind of the content type and set the same path of the view created above, follwing the example: /news
We shoudn't be able to use the path /news because it's already being used by a views.page.

Proposed resolution

Update the UnitPathAliasConstraintValidator to validate if a views page is used the path alias provided.

Remaining tasks

- Update the constraint.
- Create unit test.

πŸ› Bug report
Status

Active

Version

11.2 πŸ”₯

Component

path.module

Created by

πŸ‡§πŸ‡·Brazil joaopauloc.dev

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