Skip to content

Commit 4b45ff2

Browse files
AmpMVnMichal Vanek
andauthored
[shopsys] Change blog categories for real root category (#3595)
Co-authored-by: Michal Vanek <michal.vanek@shopsys.com>
1 parent 8df6231 commit 4b45ff2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Model/Blog/Category/BlogCategoriesQuery.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public function __construct(
2525
*/
2626
public function blogCategoriesQuery(): array
2727
{
28-
return $this->blogCategoryFacade->getAllVisibleChildrenByBlogCategoryAndDomainId(
29-
$this->blogCategoryFacade->getRootBlogCategory(),
28+
return $this->blogCategoryFacade->getAllVisibleChildrenWithRootByDomainId(
3029
$this->domain->getId(),
3130
);
3231
}

src/Model/Blog/Category/BlogCategoryResolverMap.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ protected function map(): array
4747
return $blogCategory->getSeoMetaDescription($this->domain->getId());
4848
},
4949
'parent' => function (BlogCategory $blogCategory) {
50-
$parent = $blogCategory->getParent();
51-
52-
return $parent !== null && $parent->getParent() !== null ? $parent : null;
50+
return $blogCategory->getParent();
5351
},
5452
'slug' => function (BlogCategory $blogCategory) {
5553
return '/' . $this->friendlyUrlFacade->getMainFriendlyUrlSlug($this->domain->getId(), 'front_blogcategory_detail', $blogCategory->getId());
@@ -64,8 +62,7 @@ protected function map(): array
6462
);
6563
},
6664
'blogCategoriesTree' => function () {
67-
return $this->blogCategoryFacade->getAllVisibleChildrenByBlogCategoryAndDomainId(
68-
$this->blogCategoryFacade->getRootBlogCategory(),
65+
return $this->blogCategoryFacade->getAllVisibleChildrenWithRootByDomainId(
6966
$this->domain->getId(),
7067
);
7168
},

0 commit comments

Comments
 (0)