|
7 | 7 |
|
8 | 8 | namespace Magento\Catalog\Ui\DataProvider\Product\Form\Modifier;
|
9 | 9 |
|
| 10 | +use Magento\Backend\Model\Auth\Session; |
| 11 | +use Magento\Catalog\Model\Category as CategoryModel; |
10 | 12 | use Magento\Catalog\Model\Locator\LocatorInterface;
|
11 | 13 | use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory;
|
12 |
| -use Magento\Framework\App\ObjectManager; |
13 | 14 | use Magento\Framework\App\CacheInterface;
|
| 15 | +use Magento\Framework\App\ObjectManager; |
| 16 | +use Magento\Framework\AuthorizationInterface; |
14 | 17 | use Magento\Framework\DB\Helper as DbHelper;
|
15 |
| -use Magento\Catalog\Model\Category as CategoryModel; |
16 | 18 | use Magento\Framework\Exception\LocalizedException;
|
17 | 19 | use Magento\Framework\Serialize\SerializerInterface;
|
18 |
| -use Magento\Framework\UrlInterface; |
19 | 20 | use Magento\Framework\Stdlib\ArrayManager;
|
20 |
| -use Magento\Framework\AuthorizationInterface; |
21 |
| -use Magento\Backend\Model\Auth\Session; |
| 21 | +use Magento\Framework\UrlInterface; |
22 | 22 |
|
23 | 23 | /**
|
24 | 24 | * Data provider for categories field of product page
|
@@ -52,6 +52,7 @@ class Categories extends AbstractModifier
|
52 | 52 | * @var array
|
53 | 53 | * @deprecated 101.0.0
|
54 | 54 | * @since 101.0.0
|
| 55 | + * @see Not use anymore |
55 | 56 | */
|
56 | 57 | protected $categoriesTrees = [];
|
57 | 58 |
|
@@ -128,6 +129,7 @@ public function __construct(
|
128 | 129 | *
|
129 | 130 | * @return CacheInterface
|
130 | 131 | * @deprecated 101.0.3
|
| 132 | + * @see getCategoriesTree |
131 | 133 | */
|
132 | 134 | private function getCacheManager(): CacheInterface
|
133 | 135 | {
|
@@ -442,6 +444,8 @@ private function retrieveCategoriesTree(int $storeId, array $shownCategoriesIds)
|
442 | 444 |
|
443 | 445 | $collection->addAttributeToFilter('entity_id', ['in' => array_keys($shownCategoriesIds)])
|
444 | 446 | ->addAttributeToSelect(['name', 'is_active', 'parent_id'])
|
| 447 | + ->addAttributeToSort('level', 'asc') |
| 448 | + ->addAttributeToSort('position', 'asc') |
445 | 449 | ->setStoreId($storeId);
|
446 | 450 |
|
447 | 451 | $categoryById = [
|
|
0 commit comments