Permalink
Browse files

Fix missing view variables.

When rendering a exception caught when rendering
an exception, some view variables were missing causing fatal
errors.

Fixes #2843
  • Loading branch information...
1 parent efe8364 commit 7416c530a205cce38f070d89a12f1434eab90cbf @markstory markstory committed May 5, 2012
Showing with 7 additions and 2 deletions.
  1. +5 −0 lib/Cake/Error/ExceptionRenderer.php
  2. +2 −2 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -268,6 +268,11 @@ protected function _outputMessage($template) {
$this->controller->afterFilter();
$this->controller->response->send();
} catch (Exception $e) {
+ $this->controller->set(array(
+ 'error' => $e,
+ 'name' => $e->getMessage(),
+ 'code' => $e->getCode(),
+ ));
$this->_outputMessageSafe('error500');
}
}
@@ -639,7 +639,7 @@ public function testMissingRenderSafe() {
->with('missingHelper')
->will($this->throwException($exception));
- $ExceptionRenderer->controller->expects($this->at(4))
+ $ExceptionRenderer->controller->expects($this->at(5))
->method('render')
->with('error500')
->will($this->returnValue(true));
@@ -671,7 +671,7 @@ public function testMissingSubdirRenderSafe() {
->with('error400')
->will($this->throwException($exception));
- $ExceptionRenderer->controller->expects($this->at(3))
+ $ExceptionRenderer->controller->expects($this->at(4))
->method('render')
->with('error500')
->will($this->returnValue(true));

0 comments on commit 7416c53

Please sign in to comment.