From 1c72a3657c8ae2947344abdd5354e3834b6070bc Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 23 Jan 2025 13:05:05 -0500 Subject: [PATCH] Remove unhelpful setting. --- config/vufind/channels.ini | 3 --- module/VuFind/src/VuFind/RecordTab/Channels.php | 2 +- .../src/VuFindTest/RecordTab/ChannelsTest.php | 10 +++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config/vufind/channels.ini b/config/vufind/channels.ini index de154d64749..e72feaef10b 100644 --- a/config/vufind/channels.ini +++ b/config/vufind/channels.ini @@ -20,9 +20,6 @@ cache_home_channels = true ; What text should display in the tab itself? label = "Channels" -; Should we include the channels search control in the tab? -include_channels_search_box = false - ; This section controls which providers are used for Solr searches/records. ; Providers may be followed by a colon and the name of a configuration section ; to use. If no configuration section is provided, the default of diff --git a/module/VuFind/src/VuFind/RecordTab/Channels.php b/module/VuFind/src/VuFind/RecordTab/Channels.php index fa33f6c2de8..f4798366341 100644 --- a/module/VuFind/src/VuFind/RecordTab/Channels.php +++ b/module/VuFind/src/VuFind/RecordTab/Channels.php @@ -90,7 +90,7 @@ public function getContext() $request = $this->getRequest() ?: null; $query = $request?->getQuery(); $driver = $this->getRecordDriver(); - $context = ['displaySearchBox' => $this->options['include_channels_search_box'] ?? false]; + $context = ['displaySearchBox' => false]; return $context + $this->loader->getRecordContext( $driver->getUniqueID(), $query?->get('channelToken'), diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/ChannelsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/ChannelsTest.php index 28f58bc154e..dbb8dca6c56 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/ChannelsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/ChannelsTest.php @@ -93,7 +93,7 @@ public function testSupportsAjax(): void * * @return void */ - public function testGetContextWithDefaultConfigAndWithoutRequest(): void + public function testGetContextWithoutRequest(): void { $driver = $this->createMock(RecordDriver::class); $driver->method('getUniqueID')->willReturn('foo'); @@ -108,11 +108,11 @@ public function testGetContextWithDefaultConfigAndWithoutRequest(): void } /** - * Test getContext() with non-default config and a request set. + * Test getContext() with default config and a request set. * * @return void */ - public function testGetContextWithConfigAndRequest(): void + public function testGetContextWithRequest(): void { $driver = $this->createMock(RecordDriver::class); $driver->method('getUniqueID')->willReturn('foo'); @@ -122,10 +122,10 @@ public function testGetContextWithConfigAndRequest(): void ->method('getRecordContext') ->with('foo', 'tok', 'prov', 'bar', ['recordTab', 'record']) ->willReturn(['record' => 'context']); - $channels = $this->getChannels(['include_channels_search_box' => true], $loader, $driver); + $channels = $this->getChannels([], $loader, $driver); $request = new Request(); $request->setQuery(new Parameters(['channelToken' => 'tok', 'channelProvider' => 'prov'])); $channels->setRequest($request); - $this->assertEquals(['displaySearchBox' => true, 'record' => 'context'], $channels->getContext()); + $this->assertEquals(['displaySearchBox' => false, 'record' => 'context'], $channels->getContext()); } }