mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix missing view variables.
When rendering a exception caught when rendering an exception, some view variables were missing causing fatal errors. Fixes #2843
This commit is contained in:
parent
efe836480b
commit
7416c530a2
2 changed files with 7 additions and 2 deletions
|
@ -268,6 +268,11 @@ class ExceptionRenderer {
|
|||
$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 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
->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 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
->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));
|
||||
|
|
Loading…
Reference in a new issue