diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index f4159a7ed2127b9124991c37a0c11e2c4eff87ff..3af10ee4a3debda77b4db7060f572d6bdcbdca42 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -26,8 +26,6 @@ * @link https://vufind.org Main Page */ namespace VuFind\Search\Base; -use Zend\ServiceManager\ServiceLocatorAwareInterface, - Zend\ServiceManager\ServiceLocatorInterface; use VuFindSearch\Backend\Solr\LuceneSyntaxHelper, VuFindSearch\Query\Query, VuFindSearch\Query\QueryGroup; use VuFind\Search\QueryAdapter, VuFind\Solr\Utils as SolrUtils; @@ -43,12 +41,8 @@ use VuFind\Search\QueryAdapter, VuFind\Solr\Utils as SolrUtils; * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Page */ -class Params implements ServiceLocatorAwareInterface +class Params { - use \Zend\ServiceManager\ServiceLocatorAwareTrait { - setServiceLocator as setServiceLocatorThroughTrait; - } - /** * Internal representation of user query. * @@ -1660,22 +1654,6 @@ class Params implements ServiceLocatorAwareInterface return $this->selectedShards; } - /** - * Set the service locator. - * - * @param ServiceLocatorInterface $serviceLocator Locator to register - * - * @return Params - */ - public function setServiceLocator(ServiceLocatorInterface $serviceLocator) - { - // If this isn't the top-level manager, get its parent: - if ($serviceLocator instanceof ServiceLocatorAwareInterface) { - $serviceLocator = $serviceLocator->getServiceLocator(); - } - return $this->setServiceLocatorThroughTrait($serviceLocator); - } - /** * Translate a string (or string-castable object) * diff --git a/module/VuFind/src/VuFind/Search/Params/PluginFactory.php b/module/VuFind/src/VuFind/Search/Params/PluginFactory.php index cc12adc1424d67cb625c5a2088a6a903b079c07a..9e4c4c3a02e7181d78e1999398e956003cbb7be8 100644 --- a/module/VuFind/src/VuFind/Search/Params/PluginFactory.php +++ b/module/VuFind/src/VuFind/Search/Params/PluginFactory.php @@ -66,9 +66,7 @@ class PluginFactory extends \VuFind\ServiceManager\AbstractPluginFactory ->get('VuFind\SearchOptionsPluginManager')->get($requestedName); $class = $this->getClassName($name, $requestedName); $configLoader = $serviceLocator->getServiceLocator()->get('VuFind\Config'); - array_unshift($extraParams, $configLoader); // Clone the options instance in case caller modifies it: - array_unshift($extraParams, clone($options)); - return new $class(...$extraParams); + return new $class(clone($options), $configLoader, ...$extraParams); } }