Skip to content

Commit 2e3902d

Browse files
committed
Issue 36101: fix review code
1 parent 5367cbf commit 2e3902d

File tree

1 file changed

+4
-2
lines changed
  • app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier

1 file changed

+4
-2
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
namespace Magento\Catalog\Ui\DataProvider\Product\Form\Modifier;
99

1010
use Magento\Backend\Model\Auth\Session;
11+
use Magento\Catalog\Api\Data\CategoryInterface;
1112
use Magento\Catalog\Model\Category as CategoryModel;
1213
use Magento\Catalog\Model\Locator\LocatorInterface;
1314
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory;
1415
use Magento\Framework\App\CacheInterface;
1516
use Magento\Framework\App\ObjectManager;
1617
use Magento\Framework\AuthorizationInterface;
18+
use Magento\Framework\Data\Collection;
1719
use Magento\Framework\DB\Helper as DbHelper;
1820
use Magento\Framework\Exception\LocalizedException;
1921
use Magento\Framework\Serialize\SerializerInterface;
@@ -444,8 +446,8 @@ private function retrieveCategoriesTree(int $storeId, array $shownCategoriesIds)
444446

445447
$collection->addAttributeToFilter('entity_id', ['in' => array_keys($shownCategoriesIds)])
446448
->addAttributeToSelect(['name', 'is_active', 'parent_id'])
447-
->addAttributeToSort('level', 'asc')
448-
->addAttributeToSort('position', 'asc')
449+
->addAttributeToSort(CategoryInterface::KEY_LEVEL, Collection::SORT_ORDER_ASC)
450+
->addAttributeToSort(CategoryInterface::KEY_POSITION, Collection::SORT_ORDER_ASC)
449451
->setStoreId($storeId);
450452

451453
$categoryById = [

0 commit comments

Comments
 (0)