From 3495422ac5bde8667becaa1e4afc12c9d139c69b Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 31 Mar 2012 12:42:17 +0530 Subject: [PATCH] Always use error layout when rendering error pages. --- lib/Cake/Controller/CakeErrorController.php | 6 +++++- lib/Cake/Error/ExceptionRenderer.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index eecfb838673..dec129fd1d6 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -56,7 +56,11 @@ public function __construct($request = null, $response = null) { $this->constructClasses(); $this->Components->trigger('initialize', array(&$this)); - $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors')); + $this->_set(array( + 'cacheAction' => false, + 'viewPath' => 'Errors', + 'layout' => 'error' + )); if (isset($this->RequestHandler)) { $this->RequestHandler->startup($this); } diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 3b867125457..ff1d25e6909 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -150,6 +150,7 @@ protected function _getController($exception) { $controller = new CakeErrorController($request, $response); } catch (Exception $e) { $controller = new Controller($request, $response); + $controller->layout = 'error'; $controller->viewPath = 'Errors'; } return $controller;