From 3ae2131f97b49fdd6929d6e1745d70bfc7e64976 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 9 Sep 2026 11:51:09 -0400 Subject: [PATCH 1/8] cons. vu find --- .../src/VuFind/Recommend/ConsortialVuFind.php | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 0e4a1dfbb0bb..e5d3d3476d69 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -29,7 +29,6 @@ namespace VuFind\Recommend; -use VuFind\Config\Config; use VuFind\Connection\ExternalVuFind as Connection; use function intval; @@ -67,20 +66,6 @@ class ConsortialVuFind implements RecommendInterface, \Psr\Log\LoggerAwareInterf */ protected $limit = 5; - /** - * Connection to consortial VuFind API. - * - * @var Connection - */ - protected $connection; - - /** - * ConsortialVuFind.ini configuration. - * - * @var Config - */ - protected $config; - /** * Base URL of a search results page. * @@ -119,15 +104,13 @@ class ConsortialVuFind implements RecommendInterface, \Psr\Log\LoggerAwareInterf /** * Constructor. * - * @param Config $config ConsortialVuFind.ini configuration + * @param array $config ConsortialVuFind.ini configuration * @param Connection $connection Connection to consortial VuFind API */ public function __construct( - Config $config, - Connection $connection + protected array $config, + protected Connection $connection ) { - $this->config = $config; - $this->connection = $connection; } /** @@ -146,19 +129,19 @@ public function setConfig($settings) $configSectionName = $settings[2] ?? 'ReShare'; // Read config file - $configSection = $this->config->get($configSectionName); + $configSection = $this->config[$configSectionName]; if ($configSection) { - $this->resultsBaseUrl = $configSection->results_base_url; - $this->recordBaseUrl = $configSection->record_base_url; - $this->searchFilters = $configSection->filters?->toArray() ?? []; + $this->resultsBaseUrl = $configSection['results_base_url']; + $this->recordBaseUrl = $configSection['record_base_url']; + $this->searchFilters = $configSection['filters'] ?? []; // Configure connection - $this->connection->setBaseUrl($configSection->api_base_url); + $this->connection->setBaseUrl($configSection['api_base_url']); // Confirm that required configuration is present $this->hasMinimumConfig = $this->resultsBaseUrl && $this->recordBaseUrl - && $configSection->api_base_url; + && $configSection['api_base_url']; if (!$this->hasMinimumConfig) { $this->logError("Required configuration missing in '$configSectionName' section of ConsortialVuFind.ini."); From 4b5d76569fcd061d72fc6089dd3d3c3e66a094ce Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 9 Sep 2026 11:52:21 -0400 Subject: [PATCH 2/8] factory --- module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php index 158f00f07825..d7dac5dc5fc6 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php @@ -71,7 +71,7 @@ public function __invoke( } return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('ExternalVuFind'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('ExternalVuFind'), $container->get(\VuFind\Connection\ExternalVuFind::class) ); } From f905f88c839b8a1fcdb2c2d9f973255aa6c3fdb2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 9 Sep 2026 11:53:10 -0400 Subject: [PATCH 3/8] test --- .../src/VuFindTest/Recommend/ConsortialVuFindTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php index 4fbd47dce0d6..5c1144194fae 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php @@ -30,7 +30,6 @@ namespace VuFindTest\Recommend; -use VuFind\Config\Config; use VuFind\Config\ConfigManagerInterface; use VuFind\Connection\ExternalVuFind; use VuFind\Recommend\ConsortialVuFind; @@ -144,7 +143,7 @@ protected function buildConfig(): array */ protected function buildConsortialVuFind(array $config): ConsortialVuFind { - $consortialVuFind = new ConsortialVuFind(new Config($config), $this->connector); + $consortialVuFind = new ConsortialVuFind($config, $this->connector); $consortialVuFind->setConfig('lookfor:3:ReShare'); $queryResults = $this->buildQueryResults('civil war'); From 39e24305cfb5ade387dcbb0dbd88a2eecff43679 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:55:21 -0400 Subject: [PATCH 4/8] Update module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php Co-authored-by: Demian Katz --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index e5d3d3476d69..5e500c3459f3 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -129,7 +129,7 @@ public function setConfig($settings) $configSectionName = $settings[2] ?? 'ReShare'; // Read config file - $configSection = $this->config[$configSectionName]; + $configSection = $this->config[$configSectionName] ?? []; if ($configSection) { $this->resultsBaseUrl = $configSection['results_base_url']; $this->recordBaseUrl = $configSection['record_base_url']; From fb9777640c91c086d41cf1f85fedc5fc5186822a Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:55:27 -0400 Subject: [PATCH 5/8] Update module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php Co-authored-by: Demian Katz --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 5e500c3459f3..031290a3e6a7 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -131,7 +131,7 @@ public function setConfig($settings) // Read config file $configSection = $this->config[$configSectionName] ?? []; if ($configSection) { - $this->resultsBaseUrl = $configSection['results_base_url']; + $this->resultsBaseUrl = $configSection['results_base_url'] ?? null; $this->recordBaseUrl = $configSection['record_base_url']; $this->searchFilters = $configSection['filters'] ?? []; From 4b63f45ebaa984c7b97fb19db1cb509c1cec356b Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:56:00 -0400 Subject: [PATCH 6/8] Update module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php Co-authored-by: Demian Katz --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 031290a3e6a7..0b9cc94727a4 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -132,7 +132,7 @@ public function setConfig($settings) $configSection = $this->config[$configSectionName] ?? []; if ($configSection) { $this->resultsBaseUrl = $configSection['results_base_url'] ?? null; - $this->recordBaseUrl = $configSection['record_base_url']; + $this->recordBaseUrl = $configSection['record_base_url'] ?? null; $this->searchFilters = $configSection['filters'] ?? []; // Configure connection From 6b209ae1336b8f92940f221aa5db62ff12ac7743 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:57:17 -0400 Subject: [PATCH 7/8] Update module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php Co-authored-by: Demian Katz --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 0b9cc94727a4..5bc6e0981334 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -141,7 +141,7 @@ public function setConfig($settings) // Confirm that required configuration is present $this->hasMinimumConfig = $this->resultsBaseUrl && $this->recordBaseUrl - && $configSection['api_base_url']; + && ($configSection['api_base_url'] ?? null); if (!$this->hasMinimumConfig) { $this->logError("Required configuration missing in '$configSectionName' section of ConsortialVuFind.ini."); From 4b665dd682a6c3703ec1c5f7603dc3bb4fbe8fdc Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 9 Sep 2026 13:01:56 -0400 Subject: [PATCH 8/8] fix api_base_url missing check --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 5bc6e0981334..8cd43e12f9a0 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -135,14 +135,14 @@ public function setConfig($settings) $this->recordBaseUrl = $configSection['record_base_url'] ?? null; $this->searchFilters = $configSection['filters'] ?? []; - // Configure connection - $this->connection->setBaseUrl($configSection['api_base_url']); - // Confirm that required configuration is present $this->hasMinimumConfig = $this->resultsBaseUrl && $this->recordBaseUrl && ($configSection['api_base_url'] ?? null); - if (!$this->hasMinimumConfig) { + if ($this->hasMinimumConfig) { + // Configure connection + $this->connection->setBaseUrl($configSection['api_base_url']); + } else { $this->logError("Required configuration missing in '$configSectionName' section of ConsortialVuFind.ini."); }