Feature #36627

Global Fallback Route

Added by Bastian Waidelich over 3 years ago. Updated about 3 years ago.

Status:Closed Start date:2012-04-26
Priority:Won't have this time Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:MVC - Routing
Target version:-
PHP Version: Complexity:
Has patch:No

Description

Currently, if you try to link to an action and there is no matching route, one gets an exception.
I suggest to add a new setting, that adds a "global fallback route" to the end of all configured routes if enabled. That route has no defaults and accepts all arguments via query parameters.

So if no matching route was found before, this route will match and might create an ugly URI (domain.tld?@package=Some.Package&@controller=SomeController&argument=someArgument) but no exception.

There are a few open questions though:

  • Whats a good name for that setting? "TYPO3.FLOW3.mvc.enableGlobalFallbackRoute" ?
  • Should this be enabled by default? I think, yes. We need it for the Setup for example and it will probably ease the life of FLOW3 rookies. But it would be a breaking change (because you would be able to call actions you weren't before)

History

#1 Updated by Robert Lemke over 3 years ago

I just wrote a long comment about that I like the idea and how we could refine the configuration of it. But then I played through some practical examples and came to the conclusion that it's probably not a good idea to introduce this feature.

  • the Setup tool should not need this at all. I'd rather like it to provide a specialized HttpRequestHandler which jumps in if setup is in charge. That request handler can easily add more routes if needed.
  • for beginners we still have the FLOW3 routes enabled by default. I think that it's not a big difference between having the FLOW3 routes included by default in the global Routes.yaml or setting it via a setting

That being said, I'm all in favor of providing a default fallback route which makes things as easy as possible

#2 Updated by Bastian Waidelich over 3 years ago

  • Target version deleted (1.1 beta 1)

#3 Updated by Bastian Waidelich over 3 years ago

Robert Lemke wrote:

  • the Setup tool should not need this at all.
    I'd rather like it to provide a specialized HttpRequestHandler which jumps
    in if setup is in charge. That request handler can easily add more routes if needed.

That's a good argument. When trying this out I also had the problem that the FrontendNodeRoutePartHandler always "jumped in first" even for an URI like "host.tld/?@package=TYPO3.Setup&@controller=foo" so this wouldn't have worked out-of-the box anyways.

The question is: When does the setup request handler accept a request?
And we have to solve the issue that we need to jump in the setup when no db was setup / no site has been imported.

  • for beginners we still have the FLOW3 routes enabled by default.
    I think that it's not a big difference between having the FLOW3 routes included by
    default in the global Routes.yaml or setting it via a setting

That's right. But we might need an even more generic fallback route then, in order to avoid exceptions

#4 Updated by Bastian Waidelich about 3 years ago

  • Status changed from Accepted to Closed
  • Priority changed from Should have to Won't have this time

In the meantime the Setup works without this change.

Also available in: Atom PDF