Skip to content

Conversation

@ekes
Copy link
Member

@ekes ekes commented Oct 29, 2025

What does this change?

Fixes prefixes (subdirectory, language) being included in parent path pattern for other instances.

See #335 (comment)

How to test

Set up site, or upgrade site, with multilingual and/or in a subdirectory. Create services, sub landing and pages. The paths should be correct and not repeat the language or subdirectory prefix to the path.

Present tests should continue to pass 🤞 if we want to test against this regressing then we'll have to start maybe adding multilingual tests (not such a bad idea).

@ekes
Copy link
Member Author

ekes commented Oct 29, 2025

  Problem 1
    - localgovdrupal/localgov is locked to version 3.x-dev and an update of this package was not requested.
    - localgovdrupal/localgov 3.x-dev requires localgovdrupal/localgov_services ^2.1.0 -> found localgovdrupal/localgov_services[2.1.0, ..., 2.x-dev] but it conflicts with your root composer.json require (dev-fix/2.x/335-path-alias as 1).

Ohhh... brain...

Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant, this works a treat!

New content is no longer created with the subdir in the path alias.

Existing pathauto patterns are updated with the update hooks.

We'll want some appropriate release notes to advise people who this affects to regenerate path aliases.

For example: drush pathauto:aliases-generate

@andybroomfield
Copy link
Contributor

@finnlewis Should it need to? won't the paths get updated on the next save of a page. The path alaises should be the same anyway (unless you have been running LGD in a sub directory).

@finnlewis
Copy link
Member

Fair point @andybroomfield, I guess it'd be an optional tidy up for those running in a sub-directory or on a language path.

@andybroomfield
Copy link
Contributor

Out of interest, would there be any Impact for those who have used this path pattern in other places. Assume making the same update is advised there too.

@tonypaulbarker
Copy link
Contributor

I have tested on two existing sites. I re-saved content and saw no issues. I ran a risky bulk regenerate via drush without running database updates and I saw some problems /housing/housing/council-housing .I ran a bulk regenerate with everything up to date and using the UI and saw no issues.
People should test these changes and bulk generation processes away from production.

I have not yet tested directories or step by steps.

@finnlewis finnlewis merged commit 96bd29b into 2.x Nov 4, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants