File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
app/code/Magento/CatalogGraphQl/Model/Resolver Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function resolve(
41
41
array $ args = null
42
42
) {
43
43
if (!isset ($ value ['model ' ])) {
44
- throw new LocalizedException ( __ ( ' "model" value should be specified ' )) ;
44
+ return null ;
45
45
}
46
46
/** @var \Magento\Catalog\Model\Category $category */
47
47
$ category = $ value ['model ' ];
Original file line number Diff line number Diff line change @@ -52,16 +52,18 @@ public function execute(\Iterator $iterator): array
52
52
/** @var CategoryInterface $category */
53
53
$ category = $ iterator ->current ();
54
54
$ iterator ->next ();
55
- $ pathElements = explode ("/ " , $ category ->getPath ());
56
- if (empty ($ tree )) {
57
- $ this ->startCategoryFetchLevel = count ($ pathElements ) - 1 ;
55
+ if ($ category ->getIsActive ()) {
56
+ $ pathElements = explode ("/ " , $ category ->getPath ());
57
+ if (empty ($ tree )) {
58
+ $ this ->startCategoryFetchLevel = count ($ pathElements ) - 1 ;
59
+ }
60
+ $ this ->iteratingCategory = $ category ;
61
+ $ currentLevelTree = $ this ->explodePathToArray ($ pathElements , $ this ->startCategoryFetchLevel );
62
+ if (empty ($ tree )) {
63
+ $ tree = $ currentLevelTree ;
64
+ }
65
+ $ tree = $ this ->mergeCategoriesTrees ($ currentLevelTree , $ tree );
58
66
}
59
- $ this ->iteratingCategory = $ category ;
60
- $ currentLevelTree = $ this ->explodePathToArray ($ pathElements , $ this ->startCategoryFetchLevel );
61
- if (empty ($ tree )) {
62
- $ tree = $ currentLevelTree ;
63
- }
64
- $ tree = $ this ->mergeCategoriesTrees ($ currentLevelTree , $ tree );
65
67
}
66
68
return $ tree ;
67
69
}
You can’t perform that action at this time.
0 commit comments