diff --git a/src/Plugin/facets/facet_source/SearchApiViews.php b/src/Plugin/facets/facet_source/SearchApiViews.php index 1b075d2..404c869 100644 --- a/src/Plugin/facets/facet_source/SearchApiViews.php +++ b/src/Plugin/facets/facet_source/SearchApiViews.php @@ -88,6 +88,7 @@ class SearchApiViews extends SearchApiBaseFacetSource implements SearchApiFacetS $view = Views::getView($this->pluginDefinition['view_id']); $view->setDisplay($this->pluginDefinition['view_display']); return '/' . $view->getDisplay()->getPath(); + case 'block': default: return \Drupal::service('path.current')->getPath(); @@ -151,8 +152,11 @@ class SearchApiViews extends SearchApiBaseFacetSource implements SearchApiFacetS return FALSE; case 'block': - // There is no way to know if a block is embedded on a page. - return TRUE; + // There is no way to know if a block is embedded on a page, because + // blocks can be rendered in isolation (see big_pipe, esi, ...). To be + // sure we're not disclosing information we're not sure about, we always + // return false. + return FALSE; } return FALSE; } diff --git a/src/Tests/UrlIntegrationTest.php b/src/Tests/UrlIntegrationTest.php index 63f8da3..1584416 100644 --- a/src/Tests/UrlIntegrationTest.php +++ b/src/Tests/UrlIntegrationTest.php @@ -92,7 +92,7 @@ class UrlIntegrationTest extends FacetWebTestBase { // Go to the only enabled facet source's config and change the filter key. $this->drupalGet('admin/config/search/facets'); - $this->clickLink($this->t('Configure')); + $this->clickLink($this->t('Configure'), 1); $edit = [ 'filter_key' => 'y', @@ -115,7 +115,7 @@ class UrlIntegrationTest extends FacetWebTestBase { // Go to the only enabled facet source's config and change the url // processor. $this->drupalGet('admin/config/search/facets'); - $this->clickLink($this->t('Configure')); + $this->clickLink($this->t('Configure'), 1); $edit = [ 'filter_key' => 'y',