From 061604e33517ffcf101e6dc4c7c12861a8f8f402 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 19 Sep 2012 14:58:18 -0400
Subject: [PATCH] Fixed options unset service locator bug.

---
 module/VuFind/src/VuFind/Search/Base/Options.php | 11 +++++++++++
 module/VuFind/src/VuFind/Search/Base/Params.php  |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Search/Base/Options.php b/module/VuFind/src/VuFind/Search/Base/Options.php
index e47e1affefb..157512d351a 100644
--- a/module/VuFind/src/VuFind/Search/Base/Options.php
+++ b/module/VuFind/src/VuFind/Search/Base/Options.php
@@ -559,6 +559,17 @@ abstract class Options implements ServiceLocatorAwareInterface
         return $this;
     }
 
+    /**
+     * Unset the service locator.
+     *
+     * @return Params
+     */
+    public function unsetServiceLocator()
+    {
+        $this->serviceLocator = null;
+        return $this;
+    }
+
     /**
      * Get the service locator.
      *
diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php
index 6215d78808a..ab372cc3ae6 100644
--- a/module/VuFind/src/VuFind/Search/Base/Params.php
+++ b/module/VuFind/src/VuFind/Search/Base/Params.php
@@ -1511,7 +1511,7 @@ class Params implements ServiceLocatorAwareInterface
         $this->serviceLocator = null;
         $options = $this->getOptions();
         if (method_exists($options, 'unsetServiceLocator')) {
-            $params->unsetServiceLocator();
+            $options->unsetServiceLocator();
         }
         return $this;
     }
-- 
GitLab