Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 7416c530a205cce38f070d89a12f1434eab90cbf 1 parent efe8364
@markstory markstory authored
View
5 lib/Cake/Error/ExceptionRenderer.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');
}
}
View
4 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.