#20055 Fix X-Pagination-Total-Count is always 0
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
| Fixed issues | #20055 |
PR Summary
- Refactoring ActiveDataProvider.php The code was simplified by removing unnecessary lines that were previously being used to count total items. This helps in making the program run faster and more efficiently.
- Optimization in ArrayDataProvider.php The pagination process, which controls how items are displayed over several pages, has been improved. It now uses a more efficient method for handling the distribution of items.
- Improving Conditionals in BaseDataProvider.php The process to check whether total count of items is established was restructured. This design tweak furthers optimization, by making the system smarter in how it handles counts of items.
- Code Cleanup in SqlDataProvider.php Similar to the changes in ActiveDataProvider, redundant lines were removed, simplifying the process of gathering the total count of items. This contributes to overall efficiency in the SQL data handling process.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 47.56%. Comparing base (
8861f7b) to head (90b60c1).
:exclamation: Current head 90b60c1 differs from pull request most recent head 7346a46. Consider uploading reports for the commit 7346a46 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #20070 +/- ##
=============================================
+ Coverage 13.49% 47.56% +34.07%
=============================================
Files 430 445 +15
Lines 37068 43407 +6339
=============================================
+ Hits 5002 20647 +15645
+ Misses 32066 22760 -9306
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@lav45 how about https://github.com/yiisoft/yii2/pull/20060?
@samdark This is a crutch that is long overdue for removal.
Take a look at the changes in tests/framework/data/ActiveDataProviderTest.php
Would you please add a line for CHANGELOG?
:+1: