Dispatching to a good controller but wrong action triggers a Fatal Error #3180

ThomasCantonnet opened this Issue Dec 6, 2012 · 1 comment


None yet

2 participants


CLI mode only.

If you set a console route in your config file, pointing to an existing controller (like index) but to an action that isn't set in your controller, you will be redirected to the AbstractActionController's method notFoundAction, but will end up on a Fatal Error because it will try to do a setStatusCode(404) with a \Zend\Console\Response object that doesn't implement it (obviously, it's CLI).

Call to undefined method Zend\Console\Response::setStatusCode() in Zend/Mvc/Controller/AbstractActionController.php on line 53

So I was thinking to access RouteNotFoundStrategy's method handleRouteNotFoundError but I have been unable to trigger it through an MVC_DISPATCH_ERROR event but I am not quite sure of the procedure to follow here.



Fixed with #3186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment