Skip to content

Commit f6c9dae

Browse files
Merge remote-tracking branch 'origin/2.4-develop' into MC-34262
2 parents 6411d1e + bb176b8 commit f6c9dae

File tree

236 files changed

+10452
-2256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+10452
-2256
lines changed

app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getItems()
149149
$this->_compareProduct->setAllowUsedFlat(false);
150150

151151
$this->_items = $this->_itemCollectionFactory->create();
152-
$this->_items->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
152+
$this->_items->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());
153153

154154
if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
155155
$this->_items->setCustomerId($this->currentCustomer->getCustomerId());

app/code/Magento/Catalog/Helper/Product/Compare.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function getItemCollection()
279279
// cannot be placed in constructor because of the cyclic dependency which cannot be fixed with proxy class
280280
// collection uses this helper in constructor when calling isEnabledFlat() method
281281
$this->_itemCollection = $this->_itemCollectionFactory->create();
282-
$this->_itemCollection->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
282+
$this->_itemCollection->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());
283283

284284
if ($this->_customerSession->isLoggedIn()) {
285285
$this->_itemCollection->setCustomerId($this->_customerSession->getCustomerId());
@@ -313,7 +313,7 @@ public function calculate($logout = false)
313313
{
314314
/** @var $collection Collection */
315315
$collection = $this->_itemCollectionFactory->create()
316-
->useProductItem(true);
316+
->useProductItem();
317317
if (!$logout && $this->_customerSession->isLoggedIn()) {
318318
$collection->setCustomerId($this->_customerSession->getCustomerId());
319319
} elseif ($this->_customerId) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormCategoryExistInCategoryListActionGroup">
12+
<annotations>
13+
<description>Check Category exist in Category list for Assign to Product.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
20+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="{{categoryName}}"
21+
stepKey="fillSearchCategory"/>
22+
<see selector="{{AdminProductFormSection.selectCategory(categoryName)}}" userInput="{{categoryName}}"
23+
stepKey="seeCategory"/>
24+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategorySelect"/>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormCategoryNotExistInCategoryListActionGroup">
12+
<annotations>
13+
<description>Check Category not exist in Category list for Assign to Product.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
20+
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="{{categoryName}}"
21+
stepKey="fillSearchCategory"/>
22+
<dontSee selector="{{AdminProductFormSection.selectCategory(categoryName)}}" userInput="{{categoryName}}"
23+
stepKey="seeCategory"/>
24+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategorySelect"/>
25+
</actionGroup>
26+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSubmitCategoriesPopupActionGroup">
12+
<annotations>
13+
<description>Clicks the "Done" button on the Search Categories popup.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneButton" />
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,11 @@ public function prepareProductIndex($indexData, $productData, $storeId)
572572
foreach ($indexData as $entityId => $attributeData) {
573573
foreach ($attributeData as $attributeId => $attributeValues) {
574574
$value = $this->getAttributeValue($attributeId, $attributeValues, $storeId);
575-
if (!empty($value)) {
575+
if ($value !== null && $value !== false && $value != '') {
576576
if (!isset($index[$attributeId])) {
577577
$index[$attributeId] = [];
578578
}
579-
$index[$attributeId][$entityId] = $value;
579+
$index[$attributeId][$entityId] = $value;
580580
}
581581
}
582582
}

app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontCheckUnableAdvancedSearchWithNegativePriceTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<stories value="Use Advanced Search"/>
1414
<title value="Unable negative price use to advanced search"/>
1515
<description value="Check unable negative price use to advanced search by price from and price to"/>
16+
<severity value="MAJOR"/>
1617
</annotations>
1718
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
1819
<actionGroup ref="StorefrontOpenAdvancedSearchActionGroup" stepKey="openAdvancedSearch"/>

app/code/Magento/Cms/Test/Mftf/Test/AdminDeleteCmsPageTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<stories value="Delete a CMS Page via the Admin"/>
1515
<title value="Admin should be able to delete CMS Pages"/>
1616
<description value="Admin should be able to delete CMS Pages"/>
17+
<severity value="CRITICAL"/>
1718
<group value="Cms"/>
1819
<group value="WYSIWYGDisabled"/>
1920
</annotations>

app/code/Magento/Customer/view/frontend/email/change_email.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,5 @@
1818
{{trans "We have received a request to change the following information associated with your account at %store_name: email." store_name=$store.frontend_name}}
1919
{{trans 'If you have not authorized this action, please contact us immediately at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
2020
</p>
21-
<br>
22-
23-
<p>{{trans "Thanks,<br>%store_name" store_name=$store.frontend_name |raw}}</p>
2421

2522
{{template config_path="design/email/footer_template"}}

app/code/Magento/Customer/view/frontend/email/change_email_and_password.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,5 @@
1818
{{trans "We have received a request to change the following information associated with your account at %store_name: email, password." store_name=$store.frontend_name}}
1919
{{trans 'If you have not authorized this action, please contact us immediately at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
2020
</p>
21-
<br>
22-
23-
<p>{{trans "Thanks,<br>%store_name" store_name=$store.frontend_name |raw}}</p>
2421

2522
{{template config_path="design/email/footer_template"}}

app/code/Magento/Customer/view/frontend/email/password_reset.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@
1919
{{trans "We have received a request to change the following information associated with your account at %store_name: password." store_name=$store.frontend_name}}
2020
{{trans 'If you have not authorized this action, please contact us immediately at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
2121
</p>
22-
<br>
23-
24-
<p>{{trans "Thanks,<br>%store_name" store_name=$store.frontend_name |raw}}</p>
2522

2623
{{template config_path="design/email/footer_template"}}

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private function convertAttribute(Attribute $attribute, array $attributeValues,
209209
$productAttributes = [];
210210

211211
$retrievedValue = $this->retrieveFieldValue($attributeValues);
212-
if ($retrievedValue) {
212+
if ($retrievedValue !== null) {
213213
$productAttributes[$attribute->getAttributeCode()] = $retrievedValue;
214214

215215
if ($attribute->getIsSearchable()) {
@@ -354,7 +354,7 @@ private function getAttributeOptions(Attribute $attribute, int $storeId): array
354354
*/
355355
private function retrieveFieldValue(array $values)
356356
{
357-
$values = \array_filter(\array_unique($values));
357+
$values = \array_unique($values);
358358

359359
return count($values) === 1 ? \array_shift($values) : \array_values($values);
360360
}

app/code/Magento/Elasticsearch/SearchAdapter/Filter/Builder/Term.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function buildFilter(RequestFilterInterface $filter)
6868
$fieldName .= '.' . $suffix;
6969
}
7070

71-
if ($filter->getValue()) {
71+
if ($filter->getValue() !== false) {
7272
$operator = is_array($filter->getValue()) ? 'terms' : 'term';
7373
$filterQuery []= [
7474
$operator => [
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\GiftMessageGraphQl\Model\Resolver\Cart;
9+
10+
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Config\Element\Field;
12+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
13+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
14+
use Magento\Framework\GraphQl\Query\Resolver\Value;
15+
use Magento\Framework\GraphQl\Query\ResolverInterface;
16+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
17+
use Magento\GiftMessage\Api\CartRepositoryInterface;
18+
use Magento\GiftMessage\Helper\Message as GiftMessageHelper;
19+
20+
/**
21+
* Class provides ability to get GiftMessage for cart
22+
*/
23+
class GiftMessage implements ResolverInterface
24+
{
25+
/**
26+
* @var CartRepositoryInterface
27+
*/
28+
private $cartRepository;
29+
30+
/**
31+
* @var GiftMessageHelper
32+
*/
33+
private $giftMessageHelper;
34+
35+
/**
36+
* @param CartRepositoryInterface $cartRepository
37+
* @param GiftMessageHelper $giftMessageHelper
38+
*/
39+
public function __construct(
40+
CartRepositoryInterface $cartRepository,
41+
GiftMessageHelper $giftMessageHelper
42+
) {
43+
$this->cartRepository = $cartRepository;
44+
$this->giftMessageHelper = $giftMessageHelper;
45+
}
46+
47+
/**
48+
* Return information about Gift message of cart
49+
*
50+
* @param Field $field
51+
* @param ContextInterface $context
52+
* @param ResolveInfo $info
53+
* @param array|null $value
54+
* @param array|null $args
55+
*
56+
* @return array|Value|mixed
57+
*
58+
* @throws GraphQlInputException
59+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
60+
*/
61+
public function resolve(
62+
Field $field,
63+
$context,
64+
ResolveInfo $info,
65+
array $value = null,
66+
array $args = null
67+
) {
68+
if (!isset($value['model'])) {
69+
throw new GraphQlInputException(__('"model" value should be specified'));
70+
}
71+
72+
$cart = $value['model'];
73+
74+
if (!$this->giftMessageHelper->isMessagesAllowed('order', $cart)) {
75+
return null;
76+
}
77+
78+
try {
79+
$giftCartMessage = $this->cartRepository->get($cart->getId());
80+
} catch (LocalizedException $e) {
81+
throw new GraphQlInputException(__('Can\'t load cart.'));
82+
}
83+
84+
if (!isset($giftCartMessage)) {
85+
return null;
86+
}
87+
88+
return [
89+
'to' => $giftCartMessage->getRecipient() ?? '',
90+
'from' => $giftCartMessage->getSender() ?? '',
91+
'message'=> $giftCartMessage->getMessage() ?? ''
92+
];
93+
}
94+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\GiftMessageGraphQl\Model\Resolver\Order;
9+
10+
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\GraphQl\Config\Element\Field;
12+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
13+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
14+
use Magento\Framework\GraphQl\Query\Resolver\Value;
15+
use Magento\Framework\GraphQl\Query\ResolverInterface;
16+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
17+
use Magento\GiftMessage\Api\OrderRepositoryInterface;
18+
19+
/**
20+
* Class for getting GiftMessage from CustomerOrder
21+
*/
22+
class GiftMessage implements ResolverInterface
23+
{
24+
/**
25+
* @var OrderRepositoryInterface
26+
*/
27+
private $orderRepository;
28+
29+
/**
30+
* @param OrderRepositoryInterface $orderRepository
31+
*/
32+
public function __construct(
33+
OrderRepositoryInterface $orderRepository
34+
) {
35+
$this->orderRepository = $orderRepository;
36+
}
37+
38+
/**
39+
* Return information about gift message for order
40+
*
41+
* @param Field $field
42+
* @param ContextInterface $context
43+
* @param ResolveInfo $info
44+
* @param array|null $value
45+
* @param array|null $args
46+
*
47+
* @return array|Value|mixed
48+
* @throws GraphQlInputException
49+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
50+
*/
51+
public function resolve(
52+
Field $field,
53+
$context,
54+
ResolveInfo $info,
55+
array $value = null,
56+
array $args = null
57+
) {
58+
if (!isset($value['id'])) {
59+
throw new GraphQlInputException(__('"id" value should be specified'));
60+
}
61+
62+
try {
63+
$orderGiftMessage = $this->orderRepository->get($value['id']);
64+
} catch (LocalizedException $e) {
65+
throw new GraphQlInputException(__('Can\'t load gift message for order'));
66+
}
67+
68+
if (!isset($orderGiftMessage)) {
69+
return null;
70+
}
71+
72+
return [
73+
'to' => $orderGiftMessage->getRecipient() ?? '',
74+
'from' => $orderGiftMessage->getSender() ?? '',
75+
'message'=> $orderGiftMessage->getMessage() ?? ''
76+
];
77+
}
78+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GiftMessageGraphQl
2+
3+
**GiftMessageGraphQl** provides information about gift messages for cart, cart items, order and order items.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "magento/module-gift-message-graph-ql",
3+
"description": "N/A",
4+
"type": "magento2-module",
5+
"require": {
6+
"php": "~7.3.0||~7.4.0",
7+
"magento/framework": "*",
8+
"magento/module-gift-message": "*"
9+
},
10+
"suggest": {
11+
"magento/module-graph-ql": "*"
12+
},
13+
"license": [
14+
"OSL-3.0",
15+
"AFL-3.0"
16+
],
17+
"autoload": {
18+
"files": [
19+
"registration.php"
20+
],
21+
"psr-4": {
22+
"Magento\\GiftMessageGraphQl\\": ""
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)