crashes with views_block_override

Created on 24 February 2025, about 1 month ago

Problem/Motivation

I tried to add an override block using the Views display type that comes with https://www.drupal.org/project/views_block_override

As soon as I add a display of this type to the view, it crashes with:

Drupal\facets\Exception\Exception: No facet source defined for facet. in Drupal\facets\Entity\Facet->getQueryType() (line 494 of modules/contrib/facets/src/Entity/Facet.php).

Drupal\facets_exposed_filters\Plugin\views\filter\FacetsFilter->query() (Line: 1433)
Drupal\views\ViewExecutable->_build('filter') (Line: 1322)
Drupal\views\ViewExecutable->build('views_block_override_1') (Line: 92)
views_fieldsets_views_ui_display_tab_alter(Array, Object, 'views_block_override_1') (Line: 552)
Drupal\Core\Extension\ModuleHandler->alter('views_ui_display_tab', Array, Object, 'views_block_override_1') (Line: 402)
Drupal\views_ui\ViewEditForm->getDisplayTab(Object) (Line: 213)
Drupal\views_ui\ViewEditForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object) (Line: 42)
Drupal\views_ui\ViewFormBase->buildForm(Array, Object)
[snip]

Steps to reproduce

1. Create a view with facets
2. Enable views_block_override module
3. Add a 'Block with overrides' display to the view

Saving the view doesn't fix the problem.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joachim
  • 🇬🇧United Kingdom joachim

    So the problem is coming from:

    1. SearchApiDisplayDeriver doesn't get a Search API display plugin for the Views display, and so it doesn't derive a facet source
    2. There isn't a Search API display because search_api only derives Search API display plugins for Views displays with core display plugins, i.e. block, page, feed, etc. views_block_override module isn't providing the integration.

    So technically the problem is with views_block_override, but Facets module needs to handle this scenario without crashing.

Production build 0.71.5 2024