Merge branch 'bugfix/page-not-found-error'

This commit is contained in:
Alexander A. Klimov 2018-01-26 16:26:08 +01:00
commit 801ccb80f0
1 changed files with 3 additions and 3 deletions

View File

@ -53,10 +53,10 @@ class ErrorController extends ActionController
$path = preg_split('~/~', $path); $path = preg_split('~/~', $path);
$path = array_shift($path); $path = array_shift($path);
$this->getResponse()->setHttpResponseCode(404); $this->getResponse()->setHttpResponseCode(404);
$this->view->message = $this->translate('Page not found.'); $this->view->messages = array($this->translate('Page not found.'));
if ($isAuthenticated) { if ($isAuthenticated) {
if ($modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { if ($modules->hasInstalled($path) && ! $modules->hasEnabled($path)) {
$this->view->message .= ' ' . sprintf( $this->view->messages[0] .= ' ' . sprintf(
$this->translate('Enabling the "%s" module might help!'), $this->translate('Enabling the "%s" module might help!'),
$path $path
); );
@ -110,7 +110,7 @@ class ErrorController extends ActionController
if ($this->getRequest()->isApiRequest()) { if ($this->getRequest()->isApiRequest()) {
$this->getResponse()->json() $this->getResponse()->json()
->setErrorMessage($this->view->message) ->setErrorMessage($this->view->messages[0])
->sendResponse(); ->sendResponse();
} }