fix: MCD-1227 Preserve active query filters in views pager page links.#505
Merged
Conversation
DrupalViewsPagination built page hrefs as bare ?page=N, discarding any other active query params. On a decoupled View that exposes filters via GET (e.g. ?text= fulltext or ?kategorie= taxonomy), paging reset the filters and returned the unfiltered result set. Merge page into the current route query instead, keeping the href query-only so it resolves against the current path. Page 0 drops the param for a clean canonical first-page URL, and the active page carries aria-current. Adds a nuxt render test mounting the drupal-view custom element with a pager under a filtered route, asserting the page links keep the filters.
fago
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DrupalViewsPagination(playground component that projects copy) builds page links as bare?page=N, discarding any other active query params — exposed View filters, search terms, etc. On a decoupled View that exposes filters via GET (e.g. a listing with?text=fulltext or?kategorie=<tid>taxonomy), paging to page 2 resets the filters and returns the unfiltered result set.Fix
Merge
pageinto the current route query (viauseRoute()) instead of composing a bare?page=N. The href stays query-only so it resolves against the current path — this keeps existing selectors likea[href="?page=1"]working. Page 0 drops thepageparam for a clean canonical first-page URL, and the active page carriesaria-current="page".Test coverage
Adds
test/nuxt/drupalViewsPagination.test.ts: mounts thedrupal-viewcustom element with a pager under a filtered route and asserts the page links keep the filters (?text=foo&kategorie=5&page=1), that page 0 drops the param, and that the active page exposesaria-current. Full nuxt suite green (63 tests).Context
Split off from MCD-1227 / MOP-535. kickstart ships its own i18n copy of this component with the same fix (kickstart PR #1258); this lands the behaviour in the upstream source so downstream copies stay in sync.
🤖 Generated with Claude Code