Issue Bug Under Review

#102604PersistedAliasMapper on translated extbase records wrong

Lois Mula Fervenza 12/05/23, 08:06 updated 11/19/26, 17:32

Description

With a language configuration of fallbackType free, the translated extbase records are not found by the RouteEnhancer PersistedAliasMapper.
The reason for this is that the UID of the extbase record from the default language is used and therefore the wrong slug is used for routing.
As soon as the l10n_parent is removed in the translated extbase record, it works.
I currently have this problem with records from the News Extension.

Reviews 1

History 611

  1. Thomas Stranz commented <span data-processor="relativetime" data-value="2024-09-17T22:35:43+00:00" > 09/17/24, 22:35 </span>

    Lois Mula Fervenza wrote:
    > With a language configuration of fallbackType free, the translated extbase records are not found by the RouteEnhancer PersistedAliasMapper.
    > The reason for this is that the UID of the extbase record from the default language is used and therefore the wrong slug is used for routing.
    > As soon as the l10n_parent is removed in the translated extbase record, it works.
    > I currently have this problem with records from the News Extension.

    I can confirm this behavior on TYPO3 12.4.20 with the following site config:

    routeEnhancers:
      News:
        type: Extbase
        extension: News
        plugin: Pi1
        routes:
          -
            routePath: '/{news-title}'
            _controller: 'News::detail'
            _arguments:
              news-title: news
        aspects:
          news-title:
            type: PersistedAliasMapper
            tableName: tx_news_domain_model_news
            routeFieldName: path_segment

    I could solve this for our project by overriding the resolveOverlay function in \TYPO3\CMS\Core\Routing\Aspect\PersistedAliasMapper via XCLASS

        protected function resolveOverlay(?array $record): ?array
        {
            $languageId = $this->siteLanguage->getLanguageId();
            if ($record === null || $languageId === 0) {
                return $record;
            }
    
            $qb = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
            $qb->select(...$this->persistenceFieldNames)->from($this->tableName)
                ->where($qb->expr()->eq('l10n_parent', $record['uid']))
                ->andWhere($qb->expr()->eq('sys_language_uid', $languageId));
    
            $overlay = $qb->executeQuery()->fetchAssociative();
            if ($overlay) {
                return $overlay;
            }
    
            return $record;
        }
  2. Oliver Pfaff commented and changed TYPO3 Version 12 13 <span data-processor="relativetime" data-value="2025-08-25T10:57:18+00:00" > 08/25/25, 10:57 </span>

    I raise the version, this behavior is the same for TYPO3 13.

    I think we have a paradigm problem here. If the language fallback is set to free, the system does not expect any connections between data records and does not check corresponding connections. However, there is the expectation that if data records are setup connected, these are then also taken into account. Here in the listview from News (https://github.com/georgringer/news/issues/2526) and in the PersistedAliasMapper. However, this cannot be expected due to the implementation paradigm and the logic behind that. Free expects independent data records per language, without a connection and therefore without the benefits of this. Such as a languageswitch, possible over PersistedAliasMapper in strict or fallback mode.

    An exception would still be nice here, but it undermines the actual clear and logical implementation.

    m2c

  3. Markus Klein commented and changed TYPO3 Version 13 12 <span data-processor="relativetime" data-value="2025-08-25T11:41:19+00:00" > 08/25/25, 11:41 </span>

    Please keep the version on the version this was reported for. Thanks.

  4. Rene Tobias commented and changed TYPO3 Version 12 13 PHP Version 8.2 8.3 <span data-processor="relativetime" data-value="2025-11-03T08:45:36+00:00" > 11/03/25, 08:45 </span>

    We have same problem in v13 :/

  5. Markus Klein commented and changed TYPO3 Version 13 12 PHP Version 8.3 8.2 <span data-processor="relativetime" data-value="2025-11-03T09:18:48+00:00" > 11/03/25, 09:18 </span>

    Please keep the version on the version this was reported for. Thanks.