From fc510a605119a28a2a20d3e9fd91878f40f282c6 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 10 Jul 2013 12:55:04 -0400
Subject: [PATCH] Made autocomplete handler aware of combined handler
 drop-down.

---
 module/VuFind/src/VuFind/Autocomplete/PluginManager.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Autocomplete/PluginManager.php b/module/VuFind/src/VuFind/Autocomplete/PluginManager.php
index 6e0d793acf7..e00eff823a9 100644
--- a/module/VuFind/src/VuFind/Autocomplete/PluginManager.php
+++ b/module/VuFind/src/VuFind/Autocomplete/PluginManager.php
@@ -69,9 +69,16 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager
         // Process incoming parameters:
         $type = $request->get($typeParam, '');
         $query = $request->get($queryParam, '');
+        $searcher = $request->get('searcher', 'Solr');
+
+        // If we're using a combined search box, we need to override the searcher
+        // and type settings.
+        if (substr($type, 0, 7) == 'VuFind:') {
+            list($junk, $tmp) = explode(':', $type, 2);
+            list($searcher, $type) = explode('|', $tmp, 2);
+        }
 
         // get Autocomplete_Type config
-        $searcher = $request->get('searcher', 'Solr');
         $options = $this->getServiceLocator()
             ->get('VuFind\SearchOptionsPluginManager')->get($searcher);
         $config = $this->getServiceLocator()->get('VuFind\Config')
-- 
GitLab