Unique alias is ignored when alias are batch generated via Pathauto

Created on 5 February 2025, 20 days ago

Problem/Motivation

Sometimes, due to various reason, you may need to batch regenerate the alias of the website, either for few un-aliased pages or for all the nodes, due to some alias pattern change.
When using the batch generation offered by Pathauto , (under /admin/config/search/path/update_bulk) this module should hook into the process to allow the unique alias to be generated when the alias sits on a different domain.
Currently the batch generation creates [non-unique-alias]-0 aliases, unlike what happens while saving the node from the create/edit form.

Steps to reproduce

  • Create a bunch of pages with the same title on different domains, without an alias
  • Run the batch generation under /admin/config/search/path/update_bulk with the option "Regenerate URL aliases for all paths" selected
  • Observe the generation of [xxx]-0 urls for pages with the same title on different domains

Proposed resolution

We could probably implement hook_pathauto_is_alias_reserved() to intervene in the bulk generation process, by checking if the module is installed and applying the same behaviour if the node belongs to a different domain.

Remaining tasks

⬜ Discover if solution is viable
⬜ Implementing the solution
⬜ Review & Test it

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia elgandoz Canberra

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

Comments & Activities

Production build 0.71.5 2024