Test that it is possible to use path prefixes in combination with language prefixes

Created on 6 September 2011, almost 13 years ago
Updated 13 February 2023, over 1 year ago

In Drupal 7 it is not possible to provide a custom URL prefix in addition to a language prefix. In D8 this has been fixed as a byproduct of work done in #1888424: Make Drupal's URL generation logic available to HttpKernel, and minimize code repetition/divergence β†’ , but there is not yet a test for this. We should test this before backporting to D7 to have test parity between both versions and to prevent possible regressions.

Original report

One of the main uses of hook_url_outbound_alter seems to be to implement path prefixing of some kind.

Core uses this in a slightly roundabout way, that ends up with locale_language_url_rewrite_url being called to add 'en', 'fr' or whatever to paths such as 'node/123' so that they get rendered as: 'fr/node/123'.

However, core doesn't respect any path prefixes that may have been used by other modules already, so for example, the FB module, and PURL module both want to do path prefixing, but locale will happily wipe them out after they've done their hotness.

Attached is a simple patch that I think is enough to ensure that we all play fair.

πŸ› Bug report
Status

Closed: works as designed

Version

9.5

Component
Language systemΒ  β†’

Last updated about 21 hours ago

  • Maintained by
  • πŸ‡©πŸ‡ͺGermany @sun
Created by

πŸ‡¬πŸ‡§United Kingdom Steven Jones

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.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    It has been 7 months and further information has not been provided. I also checked on Drupal 10.1.x and found that it is not possible to have a combination of path prefixes. For example. trying to add a prefix of en/test fails with the message 'The prefix may not contain a slash.' Based on that I am closing this as works as designed. Reopen if I have misunderstood this issue.

Production build 0.69.0 2024