Bug #91453

PersistedAliasMapper not finding record, if non-translated

Added by Philipp Seiler over 1 year ago. Updated over 1 year ago.

Should have
Link Handling, Site Handling & Routing
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


  • Have a page-setup with two languages.
  • Setup News-Extension for e.g. List view and Detail view on different pages.
  • Those pages are all translated.
  • Pages are language-strict, no language-fallbacks for page content is needed. Content is copied or re-created in the translated language.
  • News-Records usually only exist in the root language (UID 0), they are never or only rarely translated. However, News of the root-language should still all be displayed on the translated pages as fallbacks as well. Therefore the NewsRepository is hooked and adjusted, so that languageFallbacks are applied. Query is adjusted in the NewsRepositoryHook:

This worked perfectly until TYPO3 v9.5.15. v9.5.14 still worked. Problem is a change in the PersistedAliasMapper and its findByRouteFieldValue-method.

PersistedAliasMapper @ v9.5.14:

$queryBuilder = $this->createQueryBuilder();
$result = $queryBuilder
        $queryBuilder->createNamedParameter($value, \PDO::PARAM_STR)
return $result !== false ? $result : null;

PersistedAliasMapper @ v9.5.15:

$languageAware = $this->languageFieldName !== null && $this->languageParentFieldName !== null;

$queryBuilder = $this->createQueryBuilder();
$constraints = [
        $queryBuilder->createNamedParameter($value, \PDO::PARAM_STR)

$languageIds = null;
if ($languageAware) {
    $languageIds = $this->resolveAllRelevantLanguageIds();
    $constraints[] = $queryBuilder->expr()->in(
        $queryBuilder->createNamedParameter($languageIds, Connection::PARAM_INT_ARRAY)

$results = $queryBuilder
// return first result record in case table is not language aware
if (!$languageAware) {
    return $results[0] ?? null;
// post-process language fallbacks
return $this->resolveLanguageFallback($results, $this->languageFieldName, $languageIds);

The problem is easily found: In the new method, an extra constraint for sys_language_uid for the current FE-language is applied, although the News of the resolved News-Slug is not translated. This leads to the News not being found by the RouteEnhancer.

A simple check if l10n_parent and sys_language_uid are present in the record's TCA are not enough. Complete language configuration including fallbacks need to be kept in mind here.

Related issues

Related to TYPO3 Core - Bug #89153: Wrong Extbase record is shown for slugClosed2019-09-11


Updated by Philipp Seiler over 1 year ago

  • Description updated (diff)

Updated by Ralph Brugger over 1 year ago

Same problem here. Records won't be found resulting in an error 404.
Rolled back to the old findByRouteFieldValue method.


Updated by Oliver Hader over 1 year ago

  • Related to Bug #89153: Wrong Extbase record is shown for slug added

Also available in: Atom PDF