Project

General

Profile

Actions

Bug #102018

open

URL suffix is not taken into account in ‪TYPO3\CMS\Core\Routing\PageSlugCandidateProvider::‪getCandidatesForPath()

Added by Stefan Maischner 8 months ago. Updated 8 months ago.

Status:
New
Priority:
Should have
Assignee:
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2023-09-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I am updating a multi domain + multi language website from TYPO3 8 to 11.

The language fallbacks are set up properly: if a page is not translated the fallback (language 0) should be the candidate to show.
Nevertheless a 404 is thrown.

I dived into the core code and found out, that the variable $slugCandidate did not use the configured suffix /
It is even removed. In TYPO 12 the behaviour is the same as I can see.

The code in TYPO3\CMS\Core\Routing\PageSlugCandidateProvider::‪getCandidatesForPath():

$slugCandidate = '/' . trim($candidate['slug'], '/');
..
if ($urlPath === $slugCandidate) {

My config.yaml:

languages:
  -
..
    languageId: 1
    fallbackType: fallback
    fallbacks: '0'
..
routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: /
    suffix: /
    index: ''
    map:
      /: 0
..

If I add the suffix to the $slugCandidate quick & dirty, the behaviour is as expected and I can move forward with the next challenges.

$slugCandidate = '/' . trim($candidate['slug'], '/') . '/';

Thanks for fixing this.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Story #101565: Frontend related translation issuesNew2023-08-03

Actions
Actions

Also available in: Atom PDF