We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53d03bb commit b3a6f38Copy full SHA for b3a6f38
app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php
@@ -58,10 +58,10 @@ public function buildTree(Collection $collection, array $topLevelCategories) : a
58
* @param array $tree
59
* @return array
60
*/
61
- private function sortTree(array $tree): array
+ private function sortTree(array &$tree): array
62
{
63
foreach ($tree as &$node) {
64
- if ($node['children']) {
+ if (!empty($node['children'])) {
65
uasort($node['children'], function ($element1, $element2) {
66
return ($element1['position'] <=> $element2['position']);
67
});
0 commit comments