Problem/Motivation

attachPagerLinkAjax() in core/modules/views/js/ajax_view.js merges the pager link's query over the view settings:

$.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), ...);

Pager links keep the page's query params, so e.g. `?view_display_id=block_1` on the page replaces the view's display in the pager request. Same for `view_name`, `view_args`, `view_path`, etc.

Related: #2703771: Pager with AJAX and path alias sets Views argument incorrectly (same function, args from the link's path).

Steps to reproduce

1. AJAX view with a pager, visit its page with `?view_display_id=some_other_display`
2. Click a pager link
3. Request uses `some_other_display`

Proposed resolution

Drop the view's own keys from the link's query before merging, so they come from page-load settings.

Remaining tasks

  • MR + test

Issue fork drupal-3636982

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

scott_euser created an issue. See original summary.

scott_euser’s picture

Issue summary: View changes
scott_euser’s picture

Issue summary: View changes
scott_euser’s picture

Status: Active » Needs review
scott_euser’s picture

Assigned: scott_euser » Unassigned
scott_euser’s picture

Issue summary: View changes