Project

General

Profile

Actions

Bug #91397

closed

PersistedAliasMapper: 404 error when linking to a detail page and linked data item is outside webroot

Added by cosmoblonde GmbH almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
Start date:
2020-05-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
pending-close
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,

due to commit https://github.com/TYPO3/TYPO3.CMS/commit/2a1bda4f7dd33dfdcd0782afd49924925a623511 it is no longer possible (since v9.5.16) to link to a detail page if the linked item is outside the webroot.
The links are generated correctly but will return a 404.

The links are configured in the site configuration yaml file as routeEnhancers using the PersistedAliasMapper.

MyDataType:
    type: Extbase
    extension: cb_test
    plugin: CB_Test
    routes:
      -
        routePath: '/{title}'
        _controller: 'Test::show'
        _arguments:
          title: idOfMyItem
    defaultController: 'Test::show'
    aspects:
      title:
        type: PersistedAliasMapper
        tableName: tx_my_test
        routeFieldName: path_segment

The detail page is within the webroot.

I have custom datatypes outside my webroot in a sysfolder. If I move the folder into the webroot, links work correctly again.

The issue is caused by the function call filterContainedInSite on line 239 in /typo3/sysext/core/Classes/Routing/Aspect/PersistedAliasMapper.php

This function is defined in /typo3/sysext/core/Classes/Routing/Aspect/SiteAccessorTrait.php and checks if the PID is inside the current site.

With multi-site installations that are using data items from a single folder for several webroots, moving folders is no solution.

Can you please adjust the PID check or add an additional configuration parameter to disable that check?


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #88720: Adding pid option to resolve function of PersistedAliasMapper (Multi-site handling and Extbase enhancer slugs)Closed2019-07-11

Actions
Related to TYPO3 Core - Bug #91378: Slug isUniqueInTable is brokenClosedXavier Perseguers2020-05-13

Actions
Is duplicate of TYPO3 Core - Bug #91235: News Detail Page 404 after upgrade 9.5.16Closed2020-04-29

Actions
Actions

Also available in: Atom PDF