diff --git a/src/Plugin/facets/widget/CheckboxWidget.php b/src/Plugin/facets/widget/CheckboxWidget.php index 27382ab..a202ccd 100644 --- a/src/Plugin/facets/widget/CheckboxWidget.php +++ b/src/Plugin/facets/widget/CheckboxWidget.php @@ -99,7 +99,7 @@ class CheckboxWidget implements WidgetInterface, FormInterface { $results = $facet->getResults(); $configuration = $facet->getWidgetConfigs(); - $show_numbers = (bool) $configuration['show_numbers']; + $show_numbers = (bool) (isset($configuration['show_numbers']) ? $configuration['show_numbers'] : FALSE); $form[$facet->getFieldAlias()] = [ '#type' => 'checkboxes', '#title' => $facet->getName(), diff --git a/src/Tests/FacetSourceTest.php b/src/Tests/FacetSourceTest.php index 42f6445..9bd8f9c 100644 --- a/src/Tests/FacetSourceTest.php +++ b/src/Tests/FacetSourceTest.php @@ -49,9 +49,9 @@ class FacetSourceTest extends FacetWebTestBase { $this->drupalPostForm(NULL, $edit, $this->t('Save')); $this->assertResponse(200); - // Test that saving worked filterkey has the new value - $this->assertField('filterKey'); - $this->assertField('urlProcessor'); + // Test that saving worked filter_key has the new value + $this->assertField('filter_key'); + $this->assertField('url_processor'); $this->assertRaw('fq'); } @@ -79,7 +79,7 @@ class FacetSourceTest extends FacetWebTestBase { // Test that saving worked and that the url processor has the new value. $this->assertField('filter_key'); $this->assertField('url_processor'); - $elements = $this->xpath('//input[@id=:id]', [':id' => 'edit-urlprocessor-dummy-query']); + $elements = $this->xpath('//input[@id=:id]', [':id' => 'edit-url-processor-dummy-query']); $this->assertEqual('dummy_query', $elements[0]['value']); } diff --git a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php index 9f15b78..58d5966 100644 --- a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php +++ b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php @@ -25,7 +25,7 @@ class SearchApiStringTest extends UnitTestCase { public function testQueryType() { $query = new SearchApiQuery([], 'search_api_query', []); $facet = new Facet( - ['options' => ['query_operator' => 'AND']], + ['query_operator' => 'AND'], 'facets_facet' );