Commit 68335a82 authored by git's avatar git Committed by borisson_

Issue #3010274 by n_e_: Fatal error when using facet summary block on Search API page

parent f9c5e312
......@@ -98,16 +98,16 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac
}
/** @var \Drupal\views\ViewExecutable $view */
$view = $facets_summary->getFacetSource()->getViewsDisplay();
$build['#attached']['drupalSettings']['facets_views_ajax'] = [
'facets_summary_ajax' => [
'facets_summary_id' => $facets_summary->id(),
'view_id' => $view->id(),
'current_display_id' => $view->current_display,
'ajax_path' => Url::fromRoute('views.ajax')->toString(),
],
];
if ($view = $facets_summary->getFacetSource()->getViewsDisplay()) {
$build['#attached']['drupalSettings']['facets_views_ajax'] = [
'facets_summary_ajax' => [
'facets_summary_id' => $facets_summary->id(),
'view_id' => $view->id(),
'current_display_id' => $view->current_display,
'ajax_path' => Url::fromRoute('views.ajax')->toString(),
],
];
}
return $build;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment