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

wants to merge 1 commit into
3 library/Zend/Mvc/Controller/AbstractActionController.php
@@ -51,6 +51,9 @@ public function notFoundAction()
$event = $this->getEvent();
$routeMatch = $event->getRouteMatch();
+ if($response instanceof \Zend\Console\Response) {
+ return null;
+ }
$routeMatch->setParam('action', 'not-found');
weierophinney Dec 11, 2012 Zend Framework member

I think the test is wrong. We still want the route match change; we simply want to not set the status code, unless we have an HTTP response.

ThomasCantonnet Dec 11, 2012

Do we want to return a ViewModel ? I can move the routeMatch or conditionally set the status code + return the ViewModel on \Zend\Http\Response. Which one is preferable ?