Skip to content

Commit ade73dc

Browse files
author
ogorkun
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into MC-32830
2 parents 58515d2 + 710b9cc commit ade73dc

File tree

37 files changed

+7749
-5846
lines changed

37 files changed

+7749
-5846
lines changed

app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<policy id="script-src">
1212
<values>
1313
<value id="adobedtm" type="host">assets.adobedtm.com</value>
14+
<value id="adobe" type="host">*.adobe.com</value>
15+
</values>
16+
</policy>
17+
<policy id="style-src">
18+
<values>
19+
<value id="adobe" type="host">*.adobe.com</value>
1420
</values>
1521
</policy>
1622
<policy id="img-src">
@@ -19,6 +25,7 @@
1925
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
2026
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
2127
<value id="everesttech" type="host">cm.everesttech.net</value>
28+
<value id="adobe" type="host">*.adobe.com</value>
2229
</values>
2330
</policy>
2431
<policy id="connect-src">
@@ -27,9 +34,15 @@
2734
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
2835
</values>
2936
</policy>
37+
<policy id="media-src">
38+
<values>
39+
<value id="adobe" type="host">*.adobe.com</value>
40+
</values>
41+
</policy>
3042
<policy id="frame-src">
3143
<values>
3244
<value id="amcdemdex" type="host">fast.amc.demdex.net</value>
45+
<value id="adobe" type="host">*.adobe.com</value>
3346
</values>
3447
</policy>
3548
</policies>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="EnableBackupFunctionality">
12+
<data key="path">system/backup/functionality_enabled</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="DisableBackupFunctionality">
16+
<!-- Magento default value -->
17+
<data key="path">system/backup/functionality_enabled</data>
18+
<data key="value">0</data>
19+
</entity>
20+
</entities>

app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-94176"/>
1919
<group value="backup"/>
20-
<skip>
21-
<issueId value="MC-5807"/>
22-
</skip>
2320
</annotations>
21+
<before>
22+
<magentoCLI command="config:set {{EnableBackupFunctionality.path}} {{EnableBackupFunctionality.value}}" stepKey="setEnableBackup"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set {{DisableBackupFunctionality.path}} {{DisableBackupFunctionality.value}}" stepKey="setDisableBackup"/>
26+
</after>
2427

2528
<!--Login to admin area-->
2629
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/>
101101
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="seeSixthRelatedProduct"/>
102102
<selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/>
103+
<waitForPageLoad stepKey="waitForLoadingAfterSelectFivePerPage"/>
103104
<dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="dontSeeSixthRelatedProduct"/>
104105

105106
<!--See related product in storefront-->

app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8585
throw new GraphQlInputException(__($e->getMessage()));
8686
}
8787

88-
$rootCategoryIds = $filterResult['category_ids'];
89-
$filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info);
88+
$rootCategoryIds = $filterResult['category_ids'] ?? [];
89+
90+
$filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId());
9091
return $filterResult;
9192
}
9293

@@ -95,13 +96,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
9596
*
9697
* @param array $categoryIds
9798
* @param ResolveInfo $info
99+
* @param int $storeId
98100
* @return array
99101
*/
100-
private function fetchCategories(array $categoryIds, ResolveInfo $info)
102+
private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId)
101103
{
102104
$fetchedCategories = [];
103105
foreach ($categoryIds as $categoryId) {
104-
$categoryTree = $this->categoryTree->getTree($info, $categoryId);
106+
$categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId);
105107
if (empty($categoryTree)) {
106108
continue;
107109
}

app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8181
} catch (InputException $e) {
8282
throw new GraphQlInputException(__($e->getMessage()));
8383
}
84-
85-
return $this->fetchCategories($rootCategoryIds, $info);
84+
return $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId());
8685
}
8786

8887
/**
8988
* Fetch category tree data
9089
*
9190
* @param array $categoryIds
9291
* @param ResolveInfo $info
92+
* @param int $storeId
9393
* @return array
9494
*/
95-
private function fetchCategories(array $categoryIds, ResolveInfo $info)
95+
private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId)
9696
{
9797
$fetchedCategories = [];
9898
foreach ($categoryIds as $categoryId) {
99-
$categoryTree = $this->categoryTree->getTree($info, $categoryId);
99+
$categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId);
100100
if (empty($categoryTree)) {
101101
continue;
102102
}

app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7171
if ($rootCategoryId !== Category::TREE_ROOT_ID) {
7272
$this->checkCategoryIsActive->execute($rootCategoryId);
7373
}
74-
$categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId);
74+
$store = $context->getExtensionAttributes()->getStore();
75+
$categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId, (int)$store->getId());
7576

7677
if (empty($categoriesTree) || ($categoriesTree->count() == 0)) {
7778
throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist'));

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ public function __construct(
8080
*
8181
* @param ResolveInfo $resolveInfo
8282
* @param int $rootCategoryId
83+
* @param int $storeId
8384
* @return \Iterator
85+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
8486
*/
85-
public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId): \Iterator
87+
public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId, int $storeId): \Iterator
8688
{
8789
$categoryQuery = $resolveInfo->fieldNodes[0];
8890
$collection = $this->collectionFactory->create();

app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,18 @@ public function __construct(
5252
* @param string $entity_type
5353
* @param int $id
5454
* @param ResolveInfo|null $info
55+
* @param int|null $storeId
5556
* @return array
5657
* @throws GraphQlNoSuchEntityException
5758
*/
5859
public function getData(
5960
string $entity_type,
6061
int $id,
61-
ResolveInfo $info = null
62+
ResolveInfo $info = null,
63+
int $storeId = null
6264
): array {
6365
$categoryId = (int)$id;
64-
$categoriesTree = $this->categoryTree->getTree($info, $categoryId);
66+
$categoriesTree = $this->categoryTree->getTree($info, $categoryId, $storeId);
6567
if (empty($categoriesTree) || ($categoriesTree->count() == 0)) {
6668
throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist'));
6769
}

app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite;
99

1010
use Magento\Catalog\Model\ProductRepository;
11+
use Magento\Framework\Exception\NoSuchEntityException;
1112
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1213
use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface;
1314

@@ -28,17 +29,23 @@ public function __construct(
2829
}
2930

3031
/**
31-
* Get product data
32+
* Get catalog tree data
3233
*
3334
* @param string $entity_type
3435
* @param int $id
3536
* @param ResolveInfo|null $info
37+
* @param int|null $storeId
3638
* @return array
37-
* @throws \Magento\Framework\Exception\NoSuchEntityException
39+
* @throws NoSuchEntityException
40+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3841
*/
39-
public function getData(string $entity_type, int $id, ResolveInfo $info = null): array
40-
{
41-
$product = $this->productRepository->getById($id);
42+
public function getData(
43+
string $entity_type,
44+
int $id,
45+
ResolveInfo $info = null,
46+
int $storeId = null
47+
): array {
48+
$product = $this->productRepository->getById($id, false, $storeId);
4249
$result = $product->getData();
4350
$result['model'] = $product;
4451
return $result;

0 commit comments

Comments
 (0)