Routing: Could not resolve route / missing package / controller / action

Hi,

im trying to use an action of a controller with f:link.action. The controller does nothing special i’m just trying to understand how this works. My problem is, that the routing fails although the error log contains the correct values.

The Controller:

<?php
namespace My\Package\Controller;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;

class MyController extends ActionController
{
	
    /**
     * @return void
     */
    public function showAction()
    {
			$this->view->assign('foo', 'bar');
    }
}

Routes.yaml

-
  name: 'Route for my controller'
  uriPattern: 'my/package/mycontroller/{@action}'
  defaults:
    '@package': 'My.Package'
    '@controller': 'MyController'
    '@format': 'html'

Fluid

<f:link.action action="show" package="My.Package" controller="MyController">some link</f:link.action>
<!-- Another attempt with a create action and a form (the createAction function in the controller is the same as the showAction)-->
<f:form class="ui reply form" action="create" controller="MyController" package="My.Package" id="myForm">
. . . 
</form>

The error messages in two log files:

System_Development.log

7-03-12 23:36:26 2310       DEBUG     Flow                 CSRF: No token required, safe request
17-03-12 23:36:26 2310       WARNING   Flow                 Router resolve(): Could not resolve a route for building an URI for the given route values.
    @action => show
    @controller => mycontroller
    @package => my.package

17-03-12 23:36:26 2310       CRITICAL  FluidAdaptor         Exception #1301610453: Could not resolve a route and its corresponding URI for the given parameters. This may be due to referring to a not existing package / controller / action while building a link or URI. Refer to log and check the backtrace for more details. - See also: 2017031223362635df06.txt

2017031223362635df06.txt

Exception #1301610453: Could not resolve a route and its corresponding URI for the given parameters. This may be due to referring to a not existing package / controller / action while building a link or URI. Refer to log and check the backtrace for more details.

119 Neos\FluidAdaptor\ViewHelpers\Link\ActionViewHelper_Original::render(“show”, array|0|, “MyController”, “My.Package”, NULL, “”, “”, array|0|, FALSE, array|0|, FALSE, TRUE, FALSE)
118 call_user_func_array(array|2|, array|13|)
. . .

I’m certainly missing something but I’m really confused since the error logs contain the correct package / controller / action identifier. What is the problem here?

You can check that the route was included via cli. There is a ./flow routing:list command that will show wether the configuration was read correctly.

Additional if your Routes.yaml is located in a custom package it is not picket up by the configuration-manager automagically like Settings.yaml or NodeTypes.yaml.

See: http://flowframework.readthedocs.io/en/latest/TheDefinitiveGuide/PartIII/Routing.html#subroutes-from-settings to find hou to notify flow about your package subroutes via Settings.

Regards, Martin

Hi,

When I look into Neos.Setup package I don’t see it’s routes been included anywhere else. Looks like Flow automatically Scans Routes.yaml files from the packages and include it. Unless I am missing something here?

Neos.Setup has it’s own RequestHandler that takes everything with /setup

Registered here


And also have a own http component (I can’t tell why, and not using Settings.yaml) where they injnect there Routes