#101162YAML Routing not working as expected
Description
I’m having strange TYPO3 YAML/Routing issue. I’ve made a plugin that basically has two Plugins. One plugin will provide Data-Index and another one Detail-View for Data which is consumed from an API. So just to clarify there are no database-records that could be mapped nor is it intended to code kind of data-sync to archive that. Actually I think routing should (and must) also work with these given.
This is my try for site-configuration YAML:
routeEnhancers:
searchIntegration:
type: Extbase
extension: Searchbar
plugin: Project
limitToPages: [4]
routes:
- routePath: '/{doiPrefix}/{projectSlug}'
_controller: 'Project::detail'
_arguments:
projectSlug: projectSlug
requirements:
doiPrefix: '^.+$'
projectSlug: '^.+$'
defaults:
# this prefix is fixed, also tried to prepend it directly in routePath
doiPrefix: '10.55776'
projectSlug: ''
This is a simplified schema for the TYPO3 Page-Tree:
/home /search <-- here is the plugin SearchBar::indexResulting in these URLs
- https://my-domain.dev/search (should be showing SearchBar::index)
- https://my-domain.dev/search/10.55776/project-slug (only here it should invoke routing to Project::detail)
- https://my-domain.dev/search —> Project::detail, which causes error, as there actually is NO project-slug!
- https://my-domain.dev/search/10.55776/project-slug —> Project::detail, works as it should.
I’ve defined requirements on routePath: ‘/{doiPrefix}/{projectSlug}’, so for my understanding this route should NOT match if the requirement-regex do not match!
But actually they seem to do right that as it works the same as they were not present.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.