diff --cc src/Plugin/facets/facet_source/SearchApiViewsDeriver.php index c9d3470,da90300..0000000 --- a/src/Plugin/facets/facet_source/SearchApiViewsDeriver.php +++ b/src/Plugin/facets/facet_source/SearchApiViewsDeriver.php @@@ -23,23 -23,30 +23,29 @@@ class SearchApiViewsDeriver extends Fac $plugin_derivatives = array(); foreach ($search_api_displays->getDefinitions() as $display) { - $machine_name = $display['view_id'] . '__' . $display['view_display']; - - $plugin_derivatives[$machine_name] = [ - 'id' => $base_plugin_id . ':' . $machine_name, - 'label' => $display['label'], - 'description' => $this->t('Provides a facet source.'), - 'view_id' => $display['view_id'], - 'view_display' => $display['view_display'], - ] + $base_plugin_definition; - - $arguments = [ - '%view' => $display['label'], - '%display' => $display['view_display'], - ]; - $sources[] = $this->t('Search API view: %view, display: %display', $arguments); + // Avoid providing corrupted displays. + if ( + isset($display['view_id']) && + isset($display['view_display']) && + isset($display['label']) + ) { + $machine_name = $display['view_id'] . '__' . $display['view_display']; + + $plugin_derivatives[$machine_name] = [ - 'id' => $base_plugin_id . ':' . $machine_name, - 'label' => $display['label'], - 'description' => $this->t('Provides a facet source.'), - 'view_id' => $display['view_id'], - 'view_display' => $display['view_display'], - ] + $base_plugin_definition; ++ 'id' => $base_plugin_id . ':' . $machine_name, ++ 'label' => $display['label'], ++ 'description' => $this->t('Provides a facet source.'), ++ 'view_id' => $display['view_id'], ++ 'view_display' => $display['view_display'], ++ ] + $base_plugin_definition; + + $arguments = [ + '%view' => $display['label'], + '%display' => $display['view_display'], + ]; + $sources[] = $this->t('Search API view: %view, display: %display', $arguments); + } } -- uasort($plugin_derivatives, array($this, 'compareDerivatives')); $this->derivatives[$base_plugin_id] = $plugin_derivatives;