Problem/Motivation

Facets 3.0.4 introduces a fatal error on any Drupal 10 site:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service
  "Drupal\Core\Theme\ThemePreprocess".

This is triggered whenever facets_preprocess_facets_item_list() runs, i.e. on any page rendering a facet, facets summary, or facets search box widget.

The cause is commit 99775089, for issue
#3589162 Support special hierarchy processors as exposed filters:

\Drupal::service(ThemePreprocess::class)->preprocessItemList($variables);

Drupal\Core\Theme\ThemePreprocess does not exist in Drupal core 10.x, it's a D11-only service.

Facets 3.0.4 still declares core_version_requirement: ^10.1 || ^11, so this
release is incorrectly marked as D10 compatible.

Steps to reproduce

  1. Install a D10.x site (reproduced on 10.6.14) with Search API and Facets 3.0.4.
  2. Configure a facet (or facets summary / facets search box widget block) and place it on a page.
  3. Visit any page where the facet is rendered.

Result: "The website encountered an unexpected error. Try again later."

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "Drupal\Core\Theme\ThemePreprocess". in Drupal\Component\DependencyInjection\Container->get() (line 159 of /docroot/core/lib/Drupal/Component/DependencyInjection/Container.php).

Comments

danchamp created an issue. See original summary.

danchamp’s picture

Issue summary: View changes
liam morland’s picture

Version: 3.0.4 » 3.0.x-dev
Status: Active » Closed (duplicate)
Related issues: +#3618076: Fatal error ServiceNotFoundException: ... "Drupal\Core\Theme\ThemePreprocess" on Drupal 10 in facets 3.0.4

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.