3.x breaks Views AJAX functionality working in 2.0.6

Created on 11 October 2023, 12 months ago
Updated 30 November 2023, 10 months ago

I'm a big fan of Facets 3.x from some early testing, but there's one major issue that stops us from finally updating our client sites!

Problem/Motivation

Facets that have been created in an environment with Views (9.5.11 in our case), Search API (8.x-1.29) and Facets 2.0.6 can be placed in the block layout and work as expected when the View has AJAX enabled.

The facet updates the URL without a refresh and updates the filtered items when the View is set to AJAX enabled.

If we take that same facet and environment and upgrade Facets to any 3.x version, the request is not handled as AJAX, even after drush cr and drush updb. We have tried placing the facet in the view instead, same result.

The View's exposed filters work just fine as AJAX queries when enabled, but interacting with the facets will lead to URL change and page refresh.

From some preliminary testing and checking issues, I have confirmed that the onRouteAlter function in RouteAlterSubscriber.php does correctly run and sets _controller to \Drupal\facets\Controller\FacetsViewsAjaxController::ajaxView, but the various functions inside there (like facetsRemoveQueryParams) for example do not seem to fire.

Steps to reproduce

1) Create an environment with Views (9.5.11), Search API (8.x-1.29) and Facets 2.0.6
2) Create relevant dummy content for a Facet
3) Create a view of that content, enable AJAX
4) Build said Facet of any type (list of links etc.)
5) Insert the facet as a block, confirm that AJAX functionality is working.
6) Update Facets to 3.x, drush updb + drush cr
7) AJAX functionality no longer seems to be working. Even if block is removed and placed in the View header/footer instead.

πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark Worries

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

Comments & Activities

Production build 0.71.5 2024