diff --git a/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php b/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php index aed36dc6401..81eb7d80e62 100644 --- a/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php +++ b/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php @@ -276,6 +276,8 @@ protected function injectException($model, $e) return; } + $model->setVariable('display_exceptions', true); + $exception = $e->getParam('exception', false); if (!$exception instanceof \Exception) { return; diff --git a/tests/ZendTest/Mvc/View/RouteNotFoundStrategyTest.php b/tests/ZendTest/Mvc/View/RouteNotFoundStrategyTest.php index 6937d153d96..58d0eb299c9 100644 --- a/tests/ZendTest/Mvc/View/RouteNotFoundStrategyTest.php +++ b/tests/ZendTest/Mvc/View/RouteNotFoundStrategyTest.php @@ -223,6 +223,7 @@ public function test404ResponsePrepares404ViewModelWithExceptionWhenAllowed() $this->assertInstanceOf('Zend\View\Model\ModelInterface', $model); $variables = $model->getVariables(); if ($allow) { + $this->assertTrue($variables['display_exceptions']); $this->assertTrue(isset($variables['exception'])); $this->assertSame($exception, $variables['exception']); } else {