Skip to content

Commit

Permalink
Remove unhelpful setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Jan 23, 2025
1 parent 062343f commit 1c72a36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions config/vufind/channels.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/RecordTab/Channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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());
}
}

0 comments on commit 1c72a36

Please sign in to comment.