Skip to content

Commit 9b18305

Browse files
committed
AC-6685::Fatal when using GraphQl query - Fixed Breadcrumb issue
1 parent 71d36d3 commit 9b18305

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider

1 file changed

+2
-2
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function getData(string $categoryPath): array
5050
$breadcrumbsData = [];
5151

5252
$pathCategoryIds = explode('/', $categoryPath);
53-
$parentCategoryIds = array_slice($pathCategoryIds, -1, 1);
53+
$parentCategoryIds = array_slice($pathCategoryIds, 2, -1);
5454

55-
if (count($parentCategoryIds) > 0) {
55+
if (count($parentCategoryIds)) {
5656
$collection = $this->collectionFactory->create();
5757
$collection->addAttributeToSelect(['name', 'url_key', 'url_path']);
5858
$collection->addAttributeToFilter('entity_id', $parentCategoryIds);

0 commit comments

Comments
 (0)