diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 517aac13ea2d6bf6fba1d22c5b91d8e98f180239..89e6be48e0abb7c0616fd4effe921b8553cdc05b 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -192,6 +192,9 @@ $config = array( 'namespaces_by_id' => array( ), 'aliases' => array( + // Alias to account for "source" field in resource table, + // which uses "VuFind" for records from Solr index. + 'VuFind' => 'Solr' ), ), 'service_manager' => array( diff --git a/module/VuFind/src/VuFind/Record/Loader.php b/module/VuFind/src/VuFind/Record/Loader.php index bdf6468dcbf4cbe2026405a17bb02533a8d516f7..a281fda23e5d4d9d2d35a8c85899a5531c0feca8 100644 --- a/module/VuFind/src/VuFind/Record/Loader.php +++ b/module/VuFind/src/VuFind/Record/Loader.php @@ -66,15 +66,8 @@ class Loader implements ServiceLocatorAwareInterface */ protected function getClassForSource($source) { - // Special case -- the VuFind record source actually maps to Solr classes; - // this is a legacy issue related to values inserted into the database by - // VuFind 1.x: - if ($source == 'VuFind') { - $source = 'Solr'; - } - - // Use the appropriate Search class to load the requested record: - $class = 'VuFind\Search\\' . $source . '\Results'; + $sm = $this->getServiceLocator()->get('SearchManager'); + $class = $sm->setSearchClassId($source)->getResultsClass(); // Throw an error if we can't find a loader class: if (!class_exists($class)) {