Language prefix makes base url incomparable

Created on 13 November 2023, over 1 year ago

If you have translations on your site that are accessed via a prefix e.g. mysite.com/de this will interfere with the strpos comparison. They should be removed before comparison.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

achap πŸ‡¦πŸ‡Ί

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

Comments & Activities

  • Issue created by @achap
  • Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • @achap opened merge request.
  • Status changed to Needs review over 1 year ago
  • achap πŸ‡¦πŸ‡Ί

    I think the module will still have issues with subdomain languages as it just removes the www during comparison but this should fix the language prefix issue.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Thank you for the merge request.

    I wonder should it instead (as well?) go through the configured list of prefixes and check each one? For example, if you have English, German and Italian configured on the site, with Italian as default, if you're on example.com/en/node/add/page and fill in a URL to example.com/de/blog/some-story it can recognize that the content path is "blog/some-story"? Some of the combinations do get a bit tricky.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This also needs tests to make sure it works as expected.

Production build 0.71.5 2024