From 20d0acd796b7f0a2900bf7aa51d250606f9dc43a Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 26 Jun 2012 14:32:17 -0400
Subject: [PATCH] Made APPLICATION_ENV control detail level of error output;
 added detailed error message to 404 page.

---
 module/VuFind/config/module.config.php       | 5 ++---
 themes/vufind/root/templates/error/404.phtml | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php
index b3363509ff7..645d928a8d3 100644
--- a/module/VuFind/config/module.config.php
+++ b/module/VuFind/config/module.config.php
@@ -27,9 +27,8 @@ $config = array(
         ),
     ),
     'view_manager' => array(
-        'display_not_found_reason' => true,
-        'display_exceptions'       => true,
-        'doctype'                  => 'HTML5',
+        'display_not_found_reason' => APPLICATION_ENV == 'development',
+        'display_exceptions'       => APPLICATION_ENV == 'development',
         'not_found_template'       => 'error/404',
         'exception_template'       => 'error/index',
         'template_path_stack'      => array(),
diff --git a/themes/vufind/root/templates/error/404.phtml b/themes/vufind/root/templates/error/404.phtml
index 44f590cdfbd..27c756e64f6 100644
--- a/themes/vufind/root/templates/error/404.phtml
+++ b/themes/vufind/root/templates/error/404.phtml
@@ -1,2 +1,3 @@
 <h1><?=$this->transEsc('An error has occurred')?></h1>
-<h2><?=$this->transEsc($this->message)?></h2>
\ No newline at end of file
+<h2><?=$this->transEsc($this->message)?></h2>
+<? if (isset($this->reason) && $this->reason): ?><b><?=$this->transEsc('Message')?>:</b> <?=$this->transEsc($this->reason)?><? endif; ?>
-- 
GitLab