Issue Bug Closed

#101162YAML Routing not working as expected

Gabriel Kaufmann TYPOworx GmbH | NewMedia 06/23/23, 12:21 updated 06/29/23, 10:16

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::index
Resulting in these URLs Actual result is, that ANY URL that contains URL-Segment “/search” will be routed to Project::detail, which isn’t logic and right:

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.