FacetsViewsAjaxController::facetsRemoveQueryParams breaks views_infinite_scroll

Created on 1 October 2024, 2 months ago

Problem/Motivation

The current 3.0.0-beta1 version of this module breaks the condition used by views_infinite_scroll in its \Drupal\views_infinite_scroll\EventSubscriber\AjaxResponseSubscriber::onResponse subscriber.

    // Only alter commands if the user has selected our pager and it attempting
    // to move beyond page 0.
    if ($view->getPager()->getPluginId() !== 'infinite_scroll' ||
      $view->getCurrentPage() === 0 ||
      $view->getPager()->getCurrentPage() === 0
    ) {
      // When the current page is 0 it might be the case that there where no
      // additional items in this case we want to still append the empty result.
      return;
    }

Steps to reproduce

- Install and activate Facets 3.0.0-beta1
- Install and activate Views Infinite Scroll 2.0.3
- Configure any view to use the infinite scroll "load more" pager and to use Ajax
- The paging is broken, without any facet being configured, or used by the view

Proposed resolution

I did not dig into why FacetsViewsAjaxController::facetsRemoveQueryParams is necessary.
I am therefore not sure what the best solution would be, to avoid breaking other modules inadvertently, when they rely on the "page" query parameter.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France arousseau

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

Comments & Activities

Production build 0.71.5 2024