Important: Route enhancers have to be limited to their pages
Description
The three route enhancers this extension ships below
Configuration/ describe the same two views, so three of their
routes are declared twice and are identical down to the mapper:
| Route | Declared in |
|---|---|
/ | Detail. and List |
{localized_ | List. and List |
/ | List. and List |
TYPO3 offers every enhancer of a site to every page of that site unless the enhancer says otherwise, and it takes the first candidate route whose path matches and whose aspects resolve. So a site that imports more than one of the three files without saying where each applies gives all of those URLs to the file it imported first.
Only resolving is ambiguous. Generating a URL is scoped to the plugin namespace being linked, so the links keep looking right and nothing points at the configuration.
Impact
On a site that imports List before Detail.,
the page carrying the Detail plugin answers 404 for every link
the list plugins generate for it — the profile argument arrives in the
namespace of the other plugin, and
Profile
receives nothing.
The two list routes fail more quietly, and in whichever direction the import
order points: the page number or the letter arrives in the wrong namespace, and
the plugin renders the unfiltered first page with status 200.
Affected Installations
Installations whose site configuration imports more than one of
List., List and Detail. — which is
what a site showing both the separate and the combined plugin needs, and what
the documentation of this extension recommended without further qualification
until now.
Installations that import a single one of the three files are not affected.
Solution
Limit each enhancer to the pages that carry its plugin. With that in place the import order no longer matters:
imports:
- resource: 'EXT:academic_persons/Configuration/Routes/List.yaml'
- resource: 'EXT:academic_persons/Configuration/Routes/ListAndDetail.yaml'
- resource: 'EXT:academic_persons/Configuration/Routes/Detail.yaml'
routeEnhancers:
ProfileListPlugin:
limitToPages: [12, 13]
ProfileListAndDetailPlugin:
limitToPages: [14]
ProfileDetailPlugin:
limitToPages: [15]
The uids are those of the pages carrying the plugin in question, in the
default language: matching derives the page as
l10n_,
so one list covers every translation of that page. Plain page uids work on
every TYPO3 version this extension supports.