Repository navigation
[6.x] Fix nocache pagination when ignoring query strings - #15788
Merged
jasonvarga merged 2 commits intoNov 9, 2026
Merged
Conversation
Contributor
|
Nice fix. One thing I noticed: // after the endsWith / normalizeQueryString blocks
$session->setPaginationUrl($url);
if (config('statamic.static_caching.ignore_query_strings', false)) {
$url = explode('?', $url)[0];
} |
Contributor
Author
|
Good catch, thanks. I now normalize the URL before setting the pagination URL and added tests for both cases in e1fe7f3. |
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.
With
ignore_query_stringsenabled, a paginated collection inside anocacheregion always renders page 1, even when you're on?page=2.The nocache endpoint strips the query string so it can find the session the cached page was written under. But the session then reads the current page from that same stripped URL, so
pageis already gone by the time the paginator asks for it.This PR fixes it by giving the session the URL the browser actually sent, and reading the page from that one. The session lookup still uses the stripped URL.
Fixes #15787