From a368e20e1be70705d670360a220a4fb633f8e181 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 17 Sep 2012 14:21:31 -0400
Subject: [PATCH] Set up translator and theme on dispatch error so we can
 display 404 page correctly.

---
 module/VuFind/src/VuFind/Bootstrap.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/module/VuFind/src/VuFind/Bootstrap.php b/module/VuFind/src/VuFind/Bootstrap.php
index bc7ed76a8f9..c3720110bb0 100644
--- a/module/VuFind/src/VuFind/Bootstrap.php
+++ b/module/VuFind/src/VuFind/Bootstrap.php
@@ -290,6 +290,7 @@ class Bootstrap
             $viewModel->setVariable('userLang', $language);
             $viewModel->setVariable('allLangs', $config->Languages);
         };
+        $this->events->attach('dispatch.error', $callback, 9000);
         $this->events->attach('dispatch', $callback, 9000);
     }
 
@@ -317,6 +318,7 @@ class Bootstrap
             $theme = new ThemeInitializer($config, $event);
             $theme->init();
         };
+        $this->events->attach('dispatch.error', $callback, 10000);
         $this->events->attach('dispatch', $callback, 10000);
     }
 
-- 
GitLab