Skip to content

Commit 1f5c123

Browse files
author
OlgaVasyltsun
committed
MC-36048: Unexpected behavior of sorting in the Magento Admin Panel
1 parent cd946e3 commit 1f5c123

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/code/Magento/Theme/Plugin/Data/Collection.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@
88
namespace Magento\Theme\Plugin\Data;
99

1010
/**
11-
* Plugin to return real current page even if it greater then collection size.
12-
*
13-
* It is necessary to return no values when we reached the last page for api requests
11+
* Plugin to return last page if current page greater then collection size.
1412
*/
1513
class Collection
1614
{
15+
/**
16+
* Return last page if current page greater then last page.
17+
*
18+
* @param \Magento\Framework\Data\Collection $subject
19+
* @param int $result
20+
* @param int $displacement
21+
* @return int
22+
*/
1723
public function afterGetCurPage(\Magento\Framework\Data\Collection $subject, int $result, int $displacement = 0)
1824
{
1925
if ($result > $subject->getLastPageNumber()) {
@@ -22,5 +28,4 @@ public function afterGetCurPage(\Magento\Framework\Data\Collection $subject, int
2228

2329
return $result;
2430
}
25-
2631
}

0 commit comments

Comments
 (0)