mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-05-03 22:33:06 +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
lib/Cake
|
@ -268,6 +268,11 @@ class ExceptionRenderer {
|
||||||
$this->controller->afterFilter();
|
$this->controller->afterFilter();
|
||||||
$this->controller->response->send();
|
$this->controller->response->send();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
$this->controller->set(array(
|
||||||
|
'error' => $e,
|
||||||
|
'name' => $e->getMessage(),
|
||||||
|
'code' => $e->getCode(),
|
||||||
|
));
|
||||||
$this->_outputMessageSafe('error500');
|
$this->_outputMessageSafe('error500');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,7 +639,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
||||||
->with('missingHelper')
|
->with('missingHelper')
|
||||||
->will($this->throwException($exception));
|
->will($this->throwException($exception));
|
||||||
|
|
||||||
$ExceptionRenderer->controller->expects($this->at(4))
|
$ExceptionRenderer->controller->expects($this->at(5))
|
||||||
->method('render')
|
->method('render')
|
||||||
->with('error500')
|
->with('error500')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
@ -671,7 +671,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
||||||
->with('error400')
|
->with('error400')
|
||||||
->will($this->throwException($exception));
|
->will($this->throwException($exception));
|
||||||
|
|
||||||
$ExceptionRenderer->controller->expects($this->at(3))
|
$ExceptionRenderer->controller->expects($this->at(4))
|
||||||
->method('render')
|
->method('render')
|
||||||
->with('error500')
|
->with('error500')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
Loading…
Add table
Reference in a new issue