You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a pageTrigger with a query param format (e.g. ?page) breaks the link for the first page when the user is on any other page. Instead of having no page parameter, the link points to the current page.
Use the pagination to jump to page 2 (or any other page except 1)
Now the URL for the first page in the pagination will be ?page=2 instead of having no query parameter for the page.
Further analysis
I think I've found the reason for this bug in getPageUrl method in Paginate.
If it's the first page the code doesn't add the query param to the url while preserving any existing params. Both behaviors on their own are fine, however if the page query param exists, it is kept and results in the wrong URL.
Additional info
Craft version: 3.2.1
PHP version: 7.2.19
The text was updated successfully, but these errors were encountered:
Description
Using a
pageTrigger
with a query param format (e.g.?page
) breaks the link for the first page when the user is on any other page. Instead of having nopage
parameter, the link points to the current page.Steps to reproduce
pageTrigger
config to?page
?page=2
instead of having no query parameter for the page.Further analysis
I think I've found the reason for this bug in
getPageUrl
method inPaginate
.If it's the first page the code doesn't add the query param to the url while preserving any existing params. Both behaviors on their own are fine, however if the
page
query param exists, it is kept and results in the wrong URL.Additional info
The text was updated successfully, but these errors were encountered: