yii2 icon indicating copy to clipboard operation
yii2 copied to clipboard

#20055 Fix X-Pagination-Total-Count is always 0

Open lav45 opened this issue 2 years ago • 5 comments

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #20055

lav45 avatar Nov 17 '23 13:11 lav45

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.

what-the-diff[bot] avatar Nov 17 '23 13:11 what-the-diff[bot]

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.

codecov[bot] avatar Nov 17 '23 13:11 codecov[bot]

@lav45 how about https://github.com/yiisoft/yii2/pull/20060?

samdark avatar Nov 23 '23 14:11 samdark

@samdark This is a crutch that is long overdue for removal.

Take a look at the changes in tests/framework/data/ActiveDataProviderTest.php

lav45 avatar Nov 24 '23 15:11 lav45

Would you please add a line for CHANGELOG?

samdark avatar Dec 04 '23 14:12 samdark

:+1:

samdark avatar May 16 '24 09:05 samdark