diff --git a/facets.module b/facets.module index 6fca7a4..1b9ec5d 100644 --- a/facets.module +++ b/facets.module @@ -92,7 +92,7 @@ function facets_entity_presave(EntityInterface $entity) { // Check if the current display is also a facet source plugin and that // is removed from the view. We use the double underscore here to make // sure that we use core convention of "plugin:derived_plugin". - $facets_source_plugin_id = 'search_api:' . $entity->id() . '__' . $display['id']; + $facets_source_plugin_id = 'search_api:views_' . $display['display_plugin'] . '__' . $entity->id() . '__' . $display['id']; if (array_key_exists($facets_source_plugin_id, $definitions) && !array_key_exists($k, $entity->get('display'))) { $entity_id = str_replace(':', '__', $facets_source_plugin_id); $source_entity = FacetSource::load($entity_id); @@ -103,7 +103,6 @@ function facets_entity_presave(EntityInterface $entity) { } } - // Loop over all deleted sources and delete the facets that were linked to // that source. if (count($sources) > 0) { diff --git a/modules/facets_summary/tests/src/Functional/IntegrationTest.php b/modules/facets_summary/tests/src/Functional/IntegrationTest.php index 3e8b7fb..903adc2 100644 --- a/modules/facets_summary/tests/src/Functional/IntegrationTest.php +++ b/modules/facets_summary/tests/src/Functional/IntegrationTest.php @@ -74,7 +74,7 @@ class IntegrationTest extends FacetsTestBase { $values = [ 'name' => 'Owl', 'id' => 'owl', - 'facet_source_id' => 'search_api:search_api_test_view__page_1', + 'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1', ]; $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save'); $this->drupalPostForm(NULL, [], 'Save'); diff --git a/tests/src/Functional/FacetSourceTest.php b/tests/src/Functional/FacetSourceTest.php index cbfdc57..55795c2 100644 --- a/tests/src/Functional/FacetSourceTest.php +++ b/tests/src/Functional/FacetSourceTest.php @@ -49,7 +49,7 @@ class FacetSourceTest extends FacetsTestBase { $this->assertResponse(200); $this->assertUrl('admin/config/search/facets'); - $this->assertText('Facet source search_api:search_api_test_view__block_1 has been saved.'); + $this->assertText('Facet source search_api:views_block__search_api_test_view__block_1 has been saved.'); $this->clickLink('Configure'); // Test that saving worked filter_key has the new value. @@ -72,7 +72,7 @@ class FacetSourceTest extends FacetsTestBase { $this->assertResponse(200); $this->assertUrl('admin/config/search/facets'); - $this->assertText('Facet source search_api:search_api_test_view__block_1 has been saved.'); + $this->assertText('Facet source search_api:views_block__search_api_test_view__block_1 has been saved.'); $this->clickLink('Configure'); // Test that saving worked and that the url processor has the new value. diff --git a/tests/src/Functional/IntegrationTest.php b/tests/src/Functional/IntegrationTest.php index 324e903..b243689 100644 --- a/tests/src/Functional/IntegrationTest.php +++ b/tests/src/Functional/IntegrationTest.php @@ -731,8 +731,8 @@ class IntegrationTest extends FacetsTestBase { $this->assertNoText('Field:'); // Check that the expected facet sources are shown. - $this->assertText('search_api:search_api_test_view__block_1'); - $this->assertText('search_api:search_api_test_view__page_1'); + $this->assertText('search_api:views_block__search_api_test_view__block_1'); + $this->assertText('search_api:views_page__search_api_test_view__page_1'); } /**