Skip to content

Commit 449a37e

Browse files
Merge remote-tracking branch 'magento-l3/ACP2E-1315' into PR-L3-21-02-2023
2 parents 9d8d22c + 1cb37c2 commit 449a37e

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getList(
8989

9090
$this->collectionPreProcessor->process($collection, $searchCriteria, $attributes, $context);
9191

92-
if ($isChildSearch) {
92+
if (!$isChildSearch) {
9393
$visibilityIds = $isSearch
9494
? $this->visibility->getVisibleInSearchIds()
9595
: $this->visibility->getVisibleInCatalogIds();

app/code/Magento/RelatedProductGraphQl/Model/Resolver/Batch/AbstractLikedProducts.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ private function findRelations(array $products, array $loadAttributes, int $link
9494
$this->searchCriteriaBuilder->addFilter('entity_id', $relatedIds, 'in');
9595
$relatedSearchResult = $this->productDataProvider->getList(
9696
$this->searchCriteriaBuilder->create(),
97-
$loadAttributes,
98-
false,
99-
true
97+
$loadAttributes
10098
);
10199
//Filling related products map.
102100
/** @var \Magento\Catalog\Api\Data\ProductInterface[] $relatedProducts */

dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function testBundleProductWithNotVisibleChildren()
212212
}
213213
$this->assertBundleBaseFields($bundleProduct, $response['products']['items'][0]);
214214

215-
$this->assertBundleProductOptions($bundleProduct, $response['products']['items'][0], false);
215+
$this->assertBundleProductOptions($bundleProduct, $response['products']['items'][0]);
216216
$this->assertNotEmpty(
217217
$response['products']['items'][0]['items'],
218218
"Precondition failed: 'items' must not be empty"
@@ -242,9 +242,8 @@ private function assertBundleBaseFields($product, $actualResponse)
242242
/**
243243
* @param ProductInterface $product
244244
* @param array $actualResponse
245-
* @param bool $isChildVisible
246245
*/
247-
private function assertBundleProductOptions($product, $actualResponse, $isChildVisible = true)
246+
private function assertBundleProductOptions($product, $actualResponse)
248247
{
249248
$this->assertNotEmpty(
250249
$actualResponse['items'],
@@ -284,22 +283,18 @@ private function assertBundleProductOptions($product, $actualResponse, $isChildV
284283
]
285284
);
286285
$this->assertEquals(
287-
$isChildVisible ? $childProduct->getName() : null,
286+
$childProduct->getName(),
288287
$actualResponse['items'][0]['options'][0]['label']
289288
);
290-
if ($isChildVisible) {
291-
$this->assertResponseFields(
292-
$actualResponse['items'][0]['options'][0]['product'],
293-
[
294-
'id' => $childProduct->getId(),
295-
'name' => $childProduct->getName(),
296-
'type_id' => $childProduct->getTypeId(),
297-
'sku' => $childProduct->getSku()
298-
]
299-
);
300-
} else {
301-
$this->assertNull($actualResponse['items'][0]['options'][0]['product']);
302-
}
289+
$this->assertResponseFields(
290+
$actualResponse['items'][0]['options'][0]['product'],
291+
[
292+
'id' => $childProduct->getId(),
293+
'name' => $childProduct->getName(),
294+
'type_id' => $childProduct->getTypeId(),
295+
'sku' => $childProduct->getSku()
296+
]
297+
);
303298
}
304299

305300
/**

0 commit comments

Comments
 (0)