From 850515b93dd6c5e45748551ce315c43ce7204f66 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 12 Jun 2015 10:28:06 -0400
Subject: [PATCH] Fixed serialization problem.

---
 module/VuFind/src/VuFind/Search/Base/Options.php | 13 +++++++++++++
 module/VuFind/src/VuFind/Search/Base/Results.php |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/module/VuFind/src/VuFind/Search/Base/Options.php b/module/VuFind/src/VuFind/Search/Base/Options.php
index 048e170f917..102d11380db 100644
--- a/module/VuFind/src/VuFind/Search/Base/Options.php
+++ b/module/VuFind/src/VuFind/Search/Base/Options.php
@@ -220,6 +220,18 @@ abstract class Options implements TranslatorAwareInterface
     public function __construct(\VuFind\Config\PluginManager $configLoader)
     {
         $this->limitOptions = [$this->defaultLimit];
+        $this->setConfigLoader($configLoader);
+    }
+
+    /**
+     * Set the config loader
+     *
+     * @param \VuFind\Config\PluginManager $configLoader Config loader
+     *
+     * @return void
+     */
+    public function setConfigLoader(\VuFind\Config\PluginManager $configLoader)
+    {
         $this->configLoader = $configLoader;
     }
 
@@ -784,6 +796,7 @@ abstract class Options implements TranslatorAwareInterface
     public function __sleep()
     {
         $vars = get_object_vars($this);
+        unset($vars['configLoader']);
         unset($vars['translator']);
         $vars = array_keys($vars);
         return $vars;
diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php
index d40ac67f341..80bed2d0ea6 100644
--- a/module/VuFind/src/VuFind/Search/Base/Results.php
+++ b/module/VuFind/src/VuFind/Search/Base/Results.php
@@ -551,6 +551,8 @@ abstract class Results implements ServiceLocatorAwareInterface
         // Restore translator:
         $this->getOptions()
             ->setTranslator($serviceLocator->get('VuFind\Translator'));
+        $this->getOptions()
+            ->setConfigLoader($serviceLocator->get('VuFind\Config'));
         return $this;
     }
 
-- 
GitLab