Hello, I just ran in a very bad issue.

Problem/Motivation

Upgrading to 3.0.4 results in a "Missing Handler" error in views filters. All filters are just lost and I can't even add them in UI.
Drupal 10.6.15 (latest)

It might be a problem with other modules (BEF, other ?), I just hadn't time to figure out.

Problem solved by downgrading to Facets 3.0.3

Sorry about this very quick issue description, I'll let you know if I find out something more about that bug.

Comments

nilsson created an issue. See original summary.

adminko’s picture

StatusFileSize
new18.9 KB

Confirm the issue, using "Facets Exposed Filters". BEF 7.1.3, Drupal 10.6.14,10.6.15.

Missing handler

electric.larry’s picture

I ran into the same problem. After upgrading to 3.0.4 on Drupal 10.6.15 all facets are gone and only the big pipe placeholders remain (invisible).

A WSOD appears after cache rebuilding:

> 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
> > core/lib/Drupal/Component/DependencyInjection/Container.php).
>
> Drupal::service() (Line: 105)
> facets_summary_preprocess_facets_summary_item_list()

This patch checks if the "ThemePreprocess::class" service exists (D11). If it doesn't it falls back to template_preprocess_item_list($variables) (D10).

electric.larry’s picture

Status: Active » Needs review
chrisla’s picture

I have the same issue. The Facets category is completely gone from the options of adding filters to a view and all existing Facets stopped working. Downgrading to 3.0.3 also works for me. No relevant errors logged or anything else noticeable.

chrisla’s picture

Investigating the differences pushed in 3.0.4 and it appears that facets_exposed_filters.php was removed at some point during this push -- https://git.drupalcode.org/project/facets/-/compare/3.0.3...3.0.4?from_p...

"modules/facets_exposed_filters/facets_exposed_filters.module" did not exist on "3.0.4"

Restoring this file solves the problem for me. I think this file needs to be restored to the main branch again.

elvin - albania drupal developer’s picture

## Drupal 10 missing handlers: `facets_exposed_filters.module` was removed

Comment #3's ThemePreprocess patch is a real Drupal 10 bug, but it is not what causes **Broken/missing handler** in Views. Comment #6 is the actual cause.

### Root cause

Facets 3.0.4 converted `facets_exposed_filters` hooks to `#[Hook]` classes in `src/Hook/` and deleted `modules/facets_exposed_filters/facets_exposed_filters.module`.

That works on Drupal 11.1+ (OOP hook collector + `facets_exposed_filters.skip_procedural_hook_scan`). Drupal 10.6 has **no** `Drupal\Core\Hook` collector, so `hook_views_data_alter()` never runs. Views then cannot map `facets_filter` fields on the Search API index, and the UI shows Broken/missing handler with no watchdog entry (the plugin class still exists).

Locally on my Drupal 10.6.15:

- `views.views_data` for the Search API index had **no** `facets_*` keys
- After restoring procedural wrappers, the same keys resolve to `facets_filter` and Views UI shows the original labels again

### Proposed fix

Restore a Drupal 10 procedural `.module` that delegates to the existing 3.0.4 hook classes. Keep `skip_procedural_hook_scan` so Drupal 11.1+ still uses the `#[Hook]` implementations only.

Also include the ThemePreprocess `hasService()` fallback from comment #3 so Drupal 10 does not WSOD on `facets_item_list` preprocess (`#3618050`).

### Steps to test

1. Drupal 10.6.x + Facets 3.0.4 + `facets_exposed_filters` + a Search API view using `facets_filter` exposed filters.
2. Visit the Views UI edit page. Before the fix: each facet filter is Broken/missing handler, and the Facets category is missing from Add filter.
3. Confirm `modules/facets_exposed_filters/facets_exposed_filters.module` is absent on 3.0.4.
4. Apply the restored `.module` wrappers (and ThemePreprocess fallback). Rebuild caches.
5. After the fix: Views UI shows the original facet filter labels, plugin class is `FacetsFilter`, and Broken/missing handler is gone.

Downgrading to 3.0.3 only works if Composer actually reinstalls 3.0.3 (`^3.0` will pull 3.0.4 again) **and** caches are rebuilt. Pinning without `composer update drupal/facets` + `drush cr` leaves the broken handlers in place.

joelpittet’s picture

Status: Needs review » Closed (duplicate)

The missing handler is reported and fixed in the MR here #3594309: Restores facets_exposed_filters.module file and uses LegacyHook for Drupal 10 and the front end list theme function is fixed here #3618076: Fatal error ServiceNotFoundException: ... "Drupal\Core\Theme\ThemePreprocess" on Drupal 10 in facets 3.0.4

Let's focus on those already RTBC patches, I will close this as a duplicate.

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.