Facets summary compatibility with views_ajax_history

Created on 16 December 2021, almost 3 years ago
Updated 6 November 2024, 15 days ago

Problem/Motivation

When we use the views_ajax_history module together with the facets summary module, the facet summary links no longer work correctly.
This is because the views_ajax_history module changes the history(window.location.href) in the Drupal.Ajax.prototype.beforSubmit() override. Further on in the Drupal.Ajax.prototype.beforeSend() method views_ajax_history will use the window.location.href to update the ajax url with the currentQuery.

The problem is when we search on a keyword the history.pushState from views_ajax_history will be called and update the window.location.href with the keyword. When we click on a facet summary link the updateFacetsView() method will be triggered. At this moment the ajax call will be executed first and after that the history.pushState. So in the Drupal.Ajax.prototype.beforeSend() the window.location.href still have the the keyword attached so the server response still have the summary links attached.

Proposed resolution

My suggestion is to first call the history.pushState before the ajax call. this will update the window.location.href to the facet summary link.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Facet summary

Created by

🇧🇪Belgium p-neyens

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024