Skip to content

Commit 9330657

Browse files
author
olysenko
committed
Merge remote-tracking branch 'origin/2.3-develop' into chaika_december
2 parents 0044f4b + 619f2db commit 9330657

File tree

260 files changed

+8452
-1818
lines changed

Some content is hidden

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

260 files changed

+8452
-1818
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Magento is thankful for any contribution that can improve our code base, documen
3939
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4040
</a>
4141

42-
<h3>Labels applied by the Magento team</h3>
43-
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
44-
Please review the <a href="https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels">Code Contributions guide</a> for detailed information on labels used in Magento 2 repositories.
42+
### Labels applied by the Magento team
43+
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
44+
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.
4545

46-
<h2>Reporting security issues</h2>
46+
## Reporting security issues
4747

48-
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account <a href="https://bugcrowd.com/magento">there</a> to submit and follow-up your issue. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
48+
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
4949

50-
Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
50+
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).
5151

52-
<h2>License</h2>
52+
## License
5353

5454
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license.
5555

@@ -59,3 +59,13 @@ Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LI
5959
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
6060
Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise.
6161

62+
## Community Engineering Slack
63+
64+
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).
65+
66+
67+
We have channels for each project. These channels are recommended for new members:
68+
69+
- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions
70+
- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes
71+
- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\AdminNotification\Model\ResourceModel;
77

88
/**
9+
* Inbox resource model
10+
*
911
* @api
1012
* @since 100.0.2
1113
*/
@@ -77,8 +79,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
7779
'is_read=?',
7880
0
7981
);
80-
$return = $connection->fetchPairs($select);
81-
return $return;
82+
return $connection->fetchPairs($select);
8283
}
8384

8485
/**

app/code/Magento/Backend/Test/Mftf/ActionGroup/LoginAsAdminActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
<argument name="adminUser" defaultValue="_ENV"/>
1414
</arguments>
1515
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
16-
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
1716
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
1817
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
1918
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
2019
<closeAdminNotification stepKey="closeAdminNotification"/>
2120
</actionGroup>
22-
</actionGroups>
21+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
*/
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="DeleteCustomerActionGroup">
1111
<arguments>
1212
<argument name="lastName" defaultValue=""/>
1313
</arguments>
14-
<click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/>
15-
<waitForPageLoad stepKey="waitForCatalogSubmenu" time="10"/>
16-
<click stepKey="clickOnAllCustomers" selector="{{CustomersSubmenuSection.allCustomers}}"/>
17-
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
14+
<!--Clear filter if exist-->
15+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
16+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>
17+
1818
<click stepKey="chooseCustomer" selector="{{CustomersPageSection.customerCheckbox(lastName)}}"/>
1919
<waitForAjaxLoad stepKey="waitForThick" time="2"/>
2020
<click stepKey="OpenActions" selector="{{CustomersPageSection.actions}}"/>
@@ -23,6 +23,5 @@
2323
<waitForPageLoad stepKey="waitForDeleteItemPopup" time="10"/>
2424
<click stepKey="clickOnOk" selector="{{CustomersPageSection.ok}}"/>
2525
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
26-
2726
</actionGroup>
28-
</actionGroups>
27+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/NewCustomerData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<data key="City">Yerevan</data>
1919
<data key="Zip">9999</data>
2020
<data key="PhoneNumber">9999</data>
21+
<data key="Country">Armenia</data>
2122
</entity>
2223

2324
</entities>

app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,18 @@
2424
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
2525
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2626
</actionGroup>
27+
28+
<!-- Add Bundle Product to Cart from the category page -->
29+
<actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup">
30+
<arguments>
31+
<argument name="productName" type="string"/>
32+
</arguments>
33+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/>
34+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/>
35+
<waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/>
36+
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/>
37+
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/>
38+
<waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/>
39+
<see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/>
40+
</actionGroup>
2741
</actionGroups>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontAddBundleProductWithZeroPriceToShoppingCartTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Add Bundle product with zero price to shopping cart"/>
15+
<title value="Add Bundle product with zero price to shopping cart"/>
16+
<description value="Add Bundle product with zero price to shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-95167"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<!--Enable freeShipping-->
23+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
24+
<!--Create category-->
25+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
26+
<!--Create simple with zero price product-->
27+
<createData entity="ApiProductWithDescription" stepKey="apiSimple">
28+
<field key="price">0</field>
29+
</createData>
30+
<!--Create Bundle product-->
31+
<createData entity="ApiBundleProductPriceViewRange" stepKey="apiBundleProduct">
32+
<requiredEntity createDataKey="createSubCategory"/>
33+
</createData>
34+
<!--Create Attribute-->
35+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
36+
<requiredEntity createDataKey="apiBundleProduct"/>
37+
</createData>
38+
<createData entity="ApiBundleLink" stepKey="createBundleLink">
39+
<requiredEntity createDataKey="apiBundleProduct"/>
40+
<requiredEntity createDataKey="bundleOption"/>
41+
<requiredEntity createDataKey="apiSimple"/>
42+
</createData>
43+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
44+
</before>
45+
<after>
46+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/>
47+
<deleteData createDataKey="apiSimple" stepKey="deleteSimple"/>
48+
<deleteData createDataKey="apiBundleProduct" stepKey="deleteBundleProduct"/>
49+
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
50+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
51+
<actionGroup ref="logout" stepKey="logout"/>
52+
</after>
53+
<!--Open category page-->
54+
<amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage"/>
55+
<!--Add bundle product to cart-->
56+
<actionGroup ref="StorefrontAddBundleProductFromCategoryToCartActionGroup" stepKey="addBundleProductToCart">
57+
<argument name="productName" value="$$apiBundleProduct.name$$"/>
58+
</actionGroup>
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
60+
61+
<!--Place order-->
62+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
63+
<argument name="shippingMethod" value="Free Shipping"/>
64+
</actionGroup>
65+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
67+
68+
<!--Check subtotal in created order-->
69+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
70+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderById">
71+
<argument name="orderId" value="$grabOrderNumber"/>
72+
</actionGroup>
73+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
74+
<waitForPageLoad stepKey="waitForAdminOrderPageLoad"/>
75+
<scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/>
76+
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="$0.00" stepKey="checkSubtotal"/>
77+
</test>
78+
</tests>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Captcha\CustomerData;
10+
11+
use Magento\Customer\CustomerData\SectionSourceInterface;
12+
13+
/**
14+
* Captcha section
15+
*/
16+
class Captcha extends \Magento\Framework\DataObject implements SectionSourceInterface
17+
{
18+
/**
19+
* @var array
20+
*/
21+
private $formIds;
22+
23+
/**
24+
* @var \Magento\Captcha\Helper\Data
25+
*/
26+
private $helper;
27+
28+
/**
29+
* @param \Magento\Captcha\Helper\Data $helper
30+
* @param array $formIds
31+
* @param array $data
32+
* @codeCoverageIgnore
33+
*/
34+
public function __construct(
35+
\Magento\Captcha\Helper\Data $helper,
36+
array $formIds,
37+
array $data = []
38+
) {
39+
parent::__construct($data);
40+
$this->helper = $helper;
41+
$this->formIds = $formIds;
42+
}
43+
44+
/**
45+
* @inheritdoc
46+
*/
47+
public function getSectionData() :array
48+
{
49+
$data = [];
50+
51+
foreach ($this->formIds as $formId) {
52+
$captchaModel = $this->helper->getCaptcha($formId);
53+
$data[$formId] = [
54+
'isRequired' => $captchaModel->isRequired(),
55+
'timestamp' => time()
56+
];
57+
}
58+
59+
return $data;
60+
}
61+
}

app/code/Magento/Captcha/Model/Checkout/ConfigProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Captcha\Model\Checkout;
77

8+
/**
9+
* Configuration provider for Captcha rendering.
10+
*/
811
class ConfigProvider implements \Magento\Checkout\Model\ConfigProviderInterface
912
{
1013
/**
@@ -38,7 +41,7 @@ public function __construct(
3841
}
3942

4043
/**
41-
* {@inheritdoc}
44+
* @inheritdoc
4245
*/
4346
public function getConfig()
4447
{
@@ -49,7 +52,8 @@ public function getConfig()
4952
'imageHeight' => $this->getImageHeight($formId),
5053
'imageSrc' => $this->getImageSrc($formId),
5154
'refreshUrl' => $this->getRefreshUrl(),
52-
'isRequired' => $this->isRequired($formId)
55+
'isRequired' => $this->isRequired($formId),
56+
'timestamp' => time()
5357
];
5458
}
5559
return $config;

app/code/Magento/Captcha/Model/Customer/Plugin/AjaxLogin.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
declare(strict_types=1);
76

87
namespace Magento\Captcha\Model\Customer\Plugin;
98

109
use Magento\Captcha\Helper\Data as CaptchaHelper;
11-
use Magento\Customer\Controller\Ajax\Login;
12-
use Magento\Framework\Controller\Result\Json;
13-
use Magento\Framework\Controller\Result\JsonFactory;
1410
use Magento\Framework\Session\SessionManagerInterface;
11+
use Magento\Framework\Controller\Result\JsonFactory;
1512

1613
/**
17-
* The plugin for ajax login controller.
14+
* Around plugin for login action.
1815
*/
1916
class AjaxLogin
2017
{
@@ -67,14 +64,16 @@ public function __construct(
6764
}
6865

6966
/**
70-
* Validates captcha during request execution.
67+
* Check captcha data on login action.
7168
*
72-
* @param Login $subject
69+
* @param \Magento\Customer\Controller\Ajax\Login $subject
7370
* @param \Closure $proceed
7471
* @return $this
72+
* @SuppressWarnings(PHPMD.NPathComplexity)
73+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
7574
*/
7675
public function aroundExecute(
77-
Login $subject,
76+
\Magento\Customer\Controller\Ajax\Login $subject,
7877
\Closure $proceed
7978
) {
8079
$captchaFormIdField = 'captcha_form_id';
@@ -99,31 +98,28 @@ public function aroundExecute(
9998
foreach ($this->formIds as $formId) {
10099
if ($formId === $loginFormId) {
101100
$captchaModel = $this->helper->getCaptcha($formId);
102-
103101
if ($captchaModel->isRequired($username)) {
104102
if (!$captchaModel->isCorrect($captchaString)) {
105103
$this->sessionManager->setUsername($username);
106104
$captchaModel->logAttempt($username);
107-
return $this->returnJsonError(__('Incorrect CAPTCHA'), true);
105+
return $this->returnJsonError(__('Incorrect CAPTCHA'));
108106
}
109107
}
110-
111108
$captchaModel->logAttempt($username);
112109
}
113110
}
114111
return $proceed();
115112
}
116113

117114
/**
118-
* Gets Json response.
115+
* Format JSON response.
119116
*
120117
* @param \Magento\Framework\Phrase $phrase
121-
* @param bool $isCaptchaRequired
122-
* @return Json
118+
* @return \Magento\Framework\Controller\Result\Json
123119
*/
124-
private function returnJsonError(\Magento\Framework\Phrase $phrase, bool $isCaptchaRequired = false): Json
120+
private function returnJsonError(\Magento\Framework\Phrase $phrase): \Magento\Framework\Controller\Result\Json
125121
{
126122
$resultJson = $this->resultJsonFactory->create();
127-
return $resultJson->setData(['errors' => true, 'message' => $phrase, 'captcha' => $isCaptchaRequired]);
123+
return $resultJson->setData(['errors' => true, 'message' => $phrase]);
128124
}
129125
}

0 commit comments

Comments
 (0)