Skip to content

Commit

Permalink
Fix calculating correct total records of admin grids in Magento 2.4.0.
Browse files Browse the repository at this point in the history
…Fixes #11
  • Loading branch information
hostep committed Aug 2, 2020
1 parent 2aa2dd6 commit 1b27d8d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Model/ResourceModel/Catalog/Category/UrlKeyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public function loadData($printQuery = false, $logQuery = false)

$this->_setIsLoaded();

// fill $this->_totalRecords by calling getSize
// if we don't do this and leave this up to Magento, it will do it too late in Magento 2.4.x
$this->getSize();

// page the data, need to do this after setting the data as loaded,
// otherwise the getCurPage would create a recursive problem
$startIndex = ($this->getCurPage() - 1) * $this->getPageSize();
Expand Down
4 changes: 4 additions & 0 deletions Model/ResourceModel/Catalog/Category/UrlPathCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public function loadData($printQuery = false, $logQuery = false)

$this->_setIsLoaded();

// fill $this->_totalRecords by calling getSize
// if we don't do this and leave this up to Magento, it will do it too late in Magento 2.4.x
$this->getSize();

// page the data, need to do this after setting the data as loaded,
// otherwise the getCurPage would create a recursive problem
$startIndex = ($this->getCurPage() - 1) * $this->getPageSize();
Expand Down
4 changes: 4 additions & 0 deletions Model/ResourceModel/Catalog/Product/UrlKeyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public function loadData($printQuery = false, $logQuery = false)

$this->_setIsLoaded();

// fill $this->_totalRecords by calling getSize
// if we don't do this and leave this up to Magento, it will do it too late in Magento 2.4.x
$this->getSize();

// page the data, need to do this after setting the data as loaded,
// otherwise the getCurPage would create a recursive problem
$startIndex = ($this->getCurPage() - 1) * $this->getPageSize();
Expand Down
4 changes: 4 additions & 0 deletions Model/ResourceModel/Catalog/Product/UrlPathCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public function loadData($printQuery = false, $logQuery = false)

$this->_setIsLoaded();

// fill $this->_totalRecords by calling getSize
// if we don't do this and leave this up to Magento, it will do it too late in Magento 2.4.x
$this->getSize();

// page the data, need to do this after setting the data as loaded,
// otherwise the getCurPage would create a recursive problem
$startIndex = ($this->getCurPage() - 1) * $this->getPageSize();
Expand Down

0 comments on commit 1b27d8d

Please sign in to comment.