Alter means of testing if a view is ajax-enabled

Created on 2 August 2023, over 1 year ago
Updated 18 September 2024, 3 months ago

Problem/Motivation

It's possible to have an ajax-enabled view on a page with query parameters set that may not be related to the view. In such cases, the test in the js file's clickHandler() method incorrectly determines that the view doesn't use ajax, and it reloads the page. Additionally, the logic handling ajax-enabled views resets all filters in the clickHandler() method; this should only be done when a user clicks on the 'reset' link.

Steps to reproduce

  1. Create an ajax-enabled view with multiple fields in an exposed filter form.
  2. Render the view on a page with a query parameter not related to the view.
  3. Set more than one filter value in the exposed filter form.
  4. Click on the 'x' to remove one of the set filters.
  5. Observe that the page reloads.

Proposed resolution

Alter the method by which js tests whether the view is ajax-enabled such that it does not rely on the presence of query parameters. Move the reset() call from clickHandler() to the section 'Reset all views exposed form filters.'

Remaining tasks

Patch forthcoming.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States COBadger

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

Comments & Activities

Production build 0.71.5 2024