Skip to content
Snippets Groups Projects
Commit 0b51ad34 authored by Jimmy Henderickx's avatar Jimmy Henderickx
Browse files

Issue #3446845 by strykaizer: Support views default display

parent 00091e7a
No related branches found
No related tags found
1 merge request!292Issue #3210353 by shkiper, mkalkbrenner, Yujiman85: Issue with browser Back...
Pipeline #292351 canceled
<?php
namespace Drupal\facets_exposed_filters\Plugin\search_api\display;
use Drupal\search_api\Plugin\search_api\display\ViewsDisplayBase;
/**
* Represents a Views default display.
*
* @SearchApiDisplay(
* id = "views_default",
* views_display_type = "default",
* deriver = "Drupal\search_api\Plugin\search_api\display\ViewsDisplayDeriver"
* )
*/
class ViewsDefault extends ViewsDisplayBase {}
......@@ -359,6 +359,13 @@ class FacetListBuilder extends DraggableListBuilder {
$facet_source_groups = [];
foreach ($facet_sources as $facet_source) {
// For now, we hide the facet sources for views display default.
// They should not be used to attach block facets.
if(substr($facet_source["display_id"], 0, 14) == 'views_default:') {
continue;
}
$facet_source_groups[$facet_source['id']] = [
'facet_source' => $facet_source,
'facets' => [],
......
......@@ -113,6 +113,11 @@ class FacetSettingsForm extends EntityForm {
$facet_sources = [];
foreach ($this->facetSourcePluginManager->getDefinitions() as $facet_source_id => $definition) {
// For now, we hide the facet sources for views display default.
// They should not be used to attach block facets.
if(substr($definition["display_id"], 0, 14) == 'views_default:') {
continue;
}
$facet_sources[$definition['id']] = !empty($definition['label']) ? $definition['label'] : $facet_source_id;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment