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

Closed
ThomasCantonnet opened this Issue Dec 6, 2012 · 1 comment

Projects

None yet

2 participants

@ThomasCantonnet

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.

Cheers.

@weierophinney
Member

Fixed with #3186

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