Skip to content

Commit b3a6f38

Browse files
committed
B2B-2469: Improve category children loading
- functional fixes
1 parent 53d03bb commit b3a6f38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public function buildTree(Collection $collection, array $topLevelCategories) : a
5858
* @param array $tree
5959
* @return array
6060
*/
61-
private function sortTree(array $tree): array
61+
private function sortTree(array &$tree): array
6262
{
6363
foreach ($tree as &$node) {
64-
if ($node['children']) {
64+
if (!empty($node['children'])) {
6565
uasort($node['children'], function ($element1, $element2) {
6666
return ($element1['position'] <=> $element2['position']);
6767
});

0 commit comments

Comments
 (0)