diff --git a/facets.install b/facets.install index 046b8ae..650d05a 100644 --- a/facets.install +++ b/facets.install @@ -8,7 +8,7 @@ use Drupal\facets\Entity\Facet; /** - * Rename facet sources to the new id, based on + * Rename old search api facet sources to the new naming scheme. */ function facets_update_8001() { /** @var \Drupal\facets\FacetInterface[] $entities */ diff --git a/src/Plugin/facets/facet_source/SearchApiDisplay.php b/src/Plugin/facets/facet_source/SearchApiDisplay.php index e923918..79b448a 100644 --- a/src/Plugin/facets/facet_source/SearchApiDisplay.php +++ b/src/Plugin/facets/facet_source/SearchApiDisplay.php @@ -135,6 +135,9 @@ class SearchApiDisplay extends FacetSourcePluginBase { * {@inheritdoc} */ public function getPath() { + // The implementation in search api tells us that this is a url object only + // if a path is defined, and null if that isn't done. This means that we + // have to check for this + create our own Url object if that's needed. if ($this->getDisplay()->getUrl() instanceof Url) { return $this->getDisplay()->getUrl(); } diff --git a/tests/facets_query_processor/src/Plugin/facets/url_processor/DummyQuery.php b/tests/facets_query_processor/src/Plugin/facets/url_processor/DummyQuery.php index 8e518c9..f757363 100644 --- a/tests/facets_query_processor/src/Plugin/facets/url_processor/DummyQuery.php +++ b/tests/facets_query_processor/src/Plugin/facets/url_processor/DummyQuery.php @@ -83,13 +83,7 @@ class DummyQuery extends UrlProcessorPluginBase { $result_get_params->set($this->filterKey, $filter_params); - if ($facet->getFacetSource()->getPath() instanceof Url) { - $url = $facet->getFacetSource()->getPath(); - } - else { - $url = Url::createFromRequest($this->request); - } - + $url = $facet->getFacetSource()->getPath(); $url->setOption('query', $result_get_params->all()); $result->setUrl($url);