Problem/Motivation

Error

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\core_views_facets\Plugin\facets\facet_source\¸::getViewsDisplay() in Drupal\facets_summary\Plugin\Block\FacetsSummaryBlock->build() (line 101 of modules/contrib/facets/modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php).

Also while editing the facet getting below error.
/admin/config/search/facets/content_state/edit
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\core_views_facets\Plugin\facets\facet_source\CoreViewsExposedFilter::getIndex() in Drupal\facets\Plugin\facets\processor\BooleanItemProcessor->supportsFacet() (line 101 of modules/contrib/facets/src/Plugin/facets/processor/BooleanItemProcessor.php).

Steps to reproduce

Tried with the below combinations. Getting the same error for all scenarios
Added One Paragraph filed which contains Taxonomy Reference in the exposed filter.
One Taxonomy reference field in Content type in the exposed filter.
Content Published status in the Exposed filter
Content Types as an Exposed filter

I am getting the same error for all of the scenarios.

Issue fork facets-3226284

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kuralarasanm created an issue. See original summary.

hugronaphor’s picture

I confirm the error "while editing the facet"

The "facets" module expects a CoreViewsExposedFilter::getIndex method triggered via BooleanItemProcessor::supportsFacet but it's missing completly

dwkitchen’s picture

Title: Getting Call to undefined method Drupal\core_views_facets\Plugin\facets\facet_source\CoreViewsExposedFilter::getViewsDisplay() Error. Doesn't work with Any fields. » BooleanItemProcessor::supportsFacet() assumes SearchApiFacetSourceInterface
Project: Core Views Facets » Facets
Version: 8.x-1.2 » 8.x-1.x-dev

The issue is with BooleanItemProcessor::supportsFacet()

Processesor should look like this:

  public function supportsFacet(FacetInterface $facet) {
    $facet_source = $facet->getFacetSource();
    if ($facet_source instanceof SearchApiFacetSourceInterface) {
      /** @var \Drupal\search_api\Item\Field $field */
      $field_identifier = $facet->getFieldIdentifier();
      $field = $facet_source->getIndex()->getField($field_identifier);

      if ($field->getType() == "boolean") {
        return TRUE;
      }
    }
...
hugronaphor’s picture

Status: Active » Needs review
FileSize
1.28 KB

borisson_’s picture

Priority: Critical » Major
Status: Needs review » Fixed
Issue tags: -getViewsDisplay, -getIndex

Thanks for the patch.

PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mkindred’s picture

NastyBooleanItemProcessor-3226284-3.patch fixed the problem I was having, which I mistakenly attributed to Core Views Facets (https://www.drupal.org/project/core_views_facets/issues/3245999#comment-...).