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

Fix default value for page in Model::paginate() #3194

Merged
merged 2 commits into from
Jul 2, 2020

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Jul 1, 2020

Description
This PR fixes the default value for the $page parameter in Model::paginate().

Ref: #3188

Checklist:

  • Securely signed commits
  • Conforms to style guide

@mmrtonmoybd
Copy link
Contributor

@michalsn pagination not working now.
It shows same data on every page , data isn't change.
I have 16 rows. I want to show 4 data per page. But it shows same data every page. Maybe it's not fixed yet.

@michalsn
Copy link
Member Author

michalsn commented Jul 1, 2020

Apparently there is another bug with segment support. I will look into it tomorrow.

@mmrtonmoybd
Copy link
Contributor

Thank you @michalsn .
I am making a magazine on codeigniter. So I need pagination to display per page posts by category. I already doing pagination with page query parameter, but my boss rejected it because it is not seo friendly url.
Almost all works are done in this project. I already two times rejected for not seo friendly pagination link.

Pagination links() method also have a problem.
If I didn't need to use pagination group, but I need to use my own pagination template.
So I basically do like

<?= $pager->links(null, 'moshiur') ?>

It gives me a error, because links first Argument must be a string null given.

Is it possible to give null value on links method both Arguments ?

@michalsn
Copy link
Member Author

michalsn commented Jul 2, 2020

@mmrtonmoybd instead of null you should use default for group name.

@mmrtonmoybd
Copy link
Contributor

@michalsn do you fixed paginate show results with segment bug ?

@michalsn
Copy link
Member Author

michalsn commented Jul 2, 2020

@mmrtonmoybd Yes, I hope it's fixed. The tests fail because of a random test failure.

@mmrtonmoybd
Copy link
Contributor

Well done @michalsn
I am seeing that you fixed many issue in codeigniter like Super Man. You are the coding hero. Thank you 😊❤️❤️
Now it is working. But codeigniter ignore your pull request.

@michalsn michalsn merged commit effa61b into codeigniter4:develop Jul 2, 2020
@michalsn
Copy link
Member Author

michalsn commented Jul 2, 2020

@mmrtonmoybd I was only waiting for you to confirm that it's working fine. Thanks for your feedback!

@mmrtonmoybd
Copy link
Contributor

mmrtonmoybd commented Jul 2, 2020

@michalsn
Codeigniter $pager->links() array contain the active boolean not working.
It return false for every page.
My current page is 5, but it return active=false for the page 5.
It is a new bug

array(3) { [0]=> array(3) { ["uri"]=> string(42) "http://localhost:8080/category/exclusive/3" ["title"]=> int(3) ["active"]=> bool(false) } [1]=> array(3) { ["uri"]=> string(42) "http://localhost:8080/category/exclusive/4" ["title"]=> int(4) ["active"]=> bool(false) } [2]=> array(3) { ["uri"]=> string(42) "http://localhost:8080/category/exclusive/5" ["title"]=> int(5) ["active"]=> bool(false) } }

@michalsn michalsn deleted the pagination_fix branch July 16, 2020 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants