From 631465b67f6d089b7089d52fdc6b6bd63ca0562d Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 7 Mar 2013 09:23:27 -0500
Subject: [PATCH] Allow search specs caching to be disabled without fatal
 error.

---
 module/VuFind/src/VuFind/Config/SearchSpecsReader.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/VuFind/src/VuFind/Config/SearchSpecsReader.php b/module/VuFind/src/VuFind/Config/SearchSpecsReader.php
index 752c70b3690..c5ce02a0165 100644
--- a/module/VuFind/src/VuFind/Config/SearchSpecsReader.php
+++ b/module/VuFind/src/VuFind/Config/SearchSpecsReader.php
@@ -75,8 +75,13 @@ class SearchSpecsReader
         // Load data if it is not already in the object's cache:
         if (!isset($this->searchSpecs[$filename])) {
             // Connect to searchspecs cache:
-            $cache = (null !== $this->cacheManager)
-                ? $this->cacheManager->getCache('searchspecs') : false;
+            try {
+                $cache = (null !== $this->cacheManager)
+                    ? $this->cacheManager->getCache('searchspecs') : false;
+            } catch (\Exception $e) {
+                // Don't blow up if we fail to retrieve the desired cache:
+                $cache = false;
+            }
 
             // Determine full configuration file path:
             $fullpath = Locator::getBaseConfigPath($filename);
-- 
GitLab