Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Pager pagination ( page value in url ) #3328

Closed
ixiDev opened this issue Jul 16, 2020 · 2 comments
Closed

Bug: Pager pagination ( page value in url ) #3328

ixiDev opened this issue Jul 16, 2020 · 2 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@ixiDev
Copy link

ixiDev commented Jul 16, 2020

Hi.
i am using a pager library to make pagination to table in html but the pagination links not correct at all .
for example :
the expected link like this : http://example.com/posts?page=2
but i got this http://example.com/posts?page_1594893828=2
i don't know where this random number (1594893828) come from .

CodeIgniter 4 version
ci_version : 4.0.2

Affected module(s)
Pager

Solution

The solution that i make to fix this error is to go to System/Pager/Pager.php class
Line 500 and replace this :
'pageSelector' => $group === 'default' ? 'page' : 'page_' . $group,
with this :
'pageSelector' => 'page',
the random number come from $group variable and it's change every time

what i want to know is is that solution that i make is it's correct or not.
Thanks <3

@ixiDev ixiDev added the bug Verified issues on the current code behavior or pull requests that will fix them label Jul 16, 2020
@michalsn
Copy link
Member

Please upgrade to the latest version - we have v4.0.4 already. Also, I was not able to reproduce this error with the latest relese.

@ixiDev
Copy link
Author

ixiDev commented Jul 17, 2020

@michalsn
Ok thanks i will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants