From 0fca1a0ee45c653ecf83baa9102ca706bae1f862 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 26 Jan 2018 15:11:28 +0100 Subject: [PATCH] Display messages of routing-time errors as expected --- application/controllers/ErrorController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 9e5d25fa5..27198fb46 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -53,10 +53,10 @@ class ErrorController extends ActionController $path = preg_split('~/~', $path); $path = array_shift($path); $this->getResponse()->setHttpResponseCode(404); - $this->view->message = $this->translate('Page not found.'); + $this->view->messages = array($this->translate('Page not found.')); if ($isAuthenticated) { if ($modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { - $this->view->message .= ' ' . sprintf( + $this->view->messages[0] .= ' ' . sprintf( $this->translate('Enabling the "%s" module might help!'), $path ); @@ -110,7 +110,7 @@ class ErrorController extends ActionController if ($this->getRequest()->isApiRequest()) { $this->getResponse()->json() - ->setErrorMessage($this->view->message) + ->setErrorMessage($this->view->messages[0]) ->sendResponse(); }