Skip to content

Commit ba12f12

Browse files
authored
Merge branch '2.4-develop' into patch-1
2 parents f44321f + 8513dfd commit ba12f12

File tree

135 files changed

+3869
-1458
lines changed

Some content is hidden

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

135 files changed

+3869
-1458
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>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontCategoryCurrentPageIsNthActionGroup">
11+
<arguments>
12+
<argument name="expectedPage" type="string"/>
13+
</arguments>
14+
15+
<grabTextFrom selector="{{StorefrontCategoryBottomToolbarSection.currentPage}}" stepKey="currentPageText"/>
16+
<assertEquals stepKey="assertIsPageNth">
17+
<expectedResult type="string">{{expectedPage}}</expectedResult>
18+
<actualResult type="variable">currentPageText</actualResult>
19+
</assertEquals>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateCategoryNextPageActionGroup">
10+
<annotations>
11+
<description>Navigates storefront category next page from toolbar</description>
12+
</annotations>
13+
<scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton"/>
14+
<click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage"/>
15+
<waitForPageLoad stepKey="waitForNextCategoryPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryBottomToolbarSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<element name="previousPage" type="button" selector=".//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'previous')]" timeout="30"/>
1313
<element name="pageNumber" type="text" selector="//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'page')]//span[2][contains(text() ,'{{var1}}')]" parameterized="true"/>
1414
<element name="perPage" type="select" selector="//*[@class='toolbar toolbar-products'][2]//select[@id='limiter']"/>
15-
<element name="currentPage" type="text" selector=".products.wrapper + .toolbar-products .pages .current span:nth-of-type(2)"/>
15+
<element name="currentPage" type="text" selector=".//*[@class='toolbar toolbar-products'][2]//li[contains(@class, 'current')]//span[2]" timeout="30"/>
1616
</section>
1717
</sections>

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/Checkout/view/frontend/layout/checkout_index_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<item name="trigger" xsi:type="string">opc-new-shipping-address</item>
106106
<item name="buttons" xsi:type="array">
107107
<item name="save" xsi:type="array">
108-
<item name="text" xsi:type="string" translate="true">Ship here</item>
108+
<item name="text" xsi:type="string" translate="true">Ship Here</item>
109109
<item name="class" xsi:type="string">action primary action-save-address</item>
110110
</item>
111111
<item name="cancel" xsi:type="array">

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+
}

0 commit comments

Comments
 (0)