Issue Bug Closed

#104518Page resolution for additional language might fail for certain slugs

Alexander Lehning 08/01/24, 08:34 updated 11/09/26, 10:07

Description

If the entrypoint of the site configuration contains the name of a page slug in a language path, the page might not be found.

Steps to reproduce the bug:
  1. create a site configuration with the entry point https://example.com/xyz
  2. entrypoint for the default language should be / (I have not tested it with other paths)
  3. entrypoint for the additional language should be /en/ (any other should work to, but this I tested)
  4. create the page “xyz” in the root page for the site configuration, the page should be available at https://example.com/xyz/xyz
  5. add a language variant for the page, which should be available at https://example.com/xyz/en/xyz
  6. if you try to access https://example.com/xyz/en/xyz you should get a 404 error

I am pretty sure the error is int the sorting in `TYPO3\CMS\Core\Routing\BestUrlMatcher::matchCollection`, as the relative slug `/xyz` is matched against the full path of the url

I tested this for version 11.5.38 but is probably in version 12 and 13, too, as the code seems the same

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-09T10:07:55+00:00" > 11/09/26, 10:07 </span>

    Fixed by #109259 (c6b1ca1b9ae on main, also in 14.3 and 13.4): MatchedRoute::getPathMatchScore() used strpos() to locate the tail, so a slug equal to the site base segment let the default language route win. With strrpos() the language route is preferred. Verified with a functional test using the setup from the description: /xyz/en/xyz resolves to the translated page on main and returns 404 with the old code. Closing as resolved.