File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
app/code/core/Mage/Adminhtml/Block/Widget Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -963,36 +963,29 @@ protected function _getExportTotals()
963
963
*
964
964
* @param string $callback
965
965
* @param array $args additional arguments for callback method
966
- * @return $this
967
966
*/
968
967
public function _exportIterateCollection ($ callback , array $ args )
969
968
{
970
969
$ originalCollection = $ this ->getCollection ();
971
970
$ count = null ;
972
971
$ page = 1 ;
973
- $ lPage = null ;
974
- $ break = false ;
975
972
976
- while ( $ break !== true ) {
973
+ do {
977
974
$ collection = clone $ originalCollection ;
978
975
$ collection ->setPageSize ($ this ->_exportPageSize );
979
976
$ collection ->setCurPage ($ page );
980
977
$ collection ->load ();
981
- if (is_null ($ count )) {
982
- $ count = $ collection ->getSize ();
983
- $ lPage = $ collection ->getLastPageNumber ();
984
- }
985
- if ($ lPage == $ page ) {
986
- $ break = true ;
987
- }
988
- $ page ++;
978
+
979
+ $ count = $ collection ->count ();
980
+
981
+ $ page ++;
989
982
990
983
foreach ($ collection as $ item ) {
991
984
call_user_func_array (array ($ this , $ callback ), array_merge (array ($ item ), $ args ));
992
985
}
993
986
$ collection ->clear ();
994
987
unset($ collection );
995
- }
988
+ } while ( $ count == $ this -> _exportPageSize );
996
989
}
997
990
998
991
/**
You can’t perform that action at this time.
0 commit comments