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

Fixes problem when paginator doesn't calculate countPages correctly in constructor #928

Merged
merged 3 commits into from
Apr 25, 2023

Conversation

butschster
Copy link
Member

Q A
Bugfix? ✔️
Breaks BC?
New feature?
Issues #900

The current implementation of the Paginator class has an issue in the constructor when we pass the $count argument. The problem is with the $countPages property which should be calculated based on the $count property, but it doesn't. This can cause incorrect pagination calculations. To solve this issue, I have updated the Paginator constructor to invoke the setCount method with the $count argument, ensuring that the $countPages property is recalculated correctly.

@butschster butschster added this to the 3.7.x milestone Apr 22, 2023
@butschster butschster self-assigned this Apr 22, 2023
@butschster butschster changed the base branch from 3.7 to master April 22, 2023 08:29
@codecov
Copy link

codecov bot commented Apr 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0f2b962) 84.76% compared to head (3c124bb) 84.76%.

❗ Current head 3c124bb differs from pull request most recent head 14842b5. Consider uploading reports for the commit 14842b5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #928   +/-   ##
=========================================
  Coverage     84.76%   84.76%           
  Complexity     5852     5852           
=========================================
  Files           764      764           
  Lines         16572    16572           
=========================================
  Hits          14047    14047           
  Misses         2525     2525           
Impacted Files Coverage Δ
src/Pagination/src/Paginator.php 86.79% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@butschster butschster modified the milestones: 3.7.x, 3.8 Apr 25, 2023
src/Pagination/tests/PaginatorTest.php Outdated Show resolved Hide resolved
@butschster butschster merged commit 8d52bb6 into master Apr 25, 2023
@butschster butschster deleted the hotfix/paginator branch April 25, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[spiral/pagination] Paginator doesn't calculate countPages correctly in constructor
2 participants