Skip to content

Commit b9e61b9

Browse files
[Magento Community Engineering] Community Contributions - 2.3-develop-expedited-prs
- merged with '2.3-develop-prs' branch
2 parents 26b952c + c5903f1 commit b9e61b9

File tree

22 files changed

+281
-102
lines changed

22 files changed

+281
-102
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Fields marked with (*) are required. Please don't remove the template.
1111

1212
### Preconditions (*)
1313
<!---
14-
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
14+
Provide the exact Magento version (example: 2.3.2) and any important information on the environment where bug is reproducible.
1515
-->
1616
1.
1717
2.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a
99

1010
## Install Magento
1111

12-
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
12+
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
1313

1414
## Learn More About GraphQL in Magento 2
1515

@@ -18,7 +18,7 @@ Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a
1818
<h2>Contributing to the Magento 2 Code Base</h2>
1919
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
2020

21-
To learn about how to make a contribution, click [here][1].
21+
To learn about how to contribute, click [here][1].
2222

2323
To learn about issues, click [here][2]. To open an issue, click [here][3].
2424

@@ -37,7 +37,7 @@ The members of this team have been recognized for their outstanding commitment t
3737
</a>
3838

3939
<h3>Top Contributors</h3>
40-
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
40+
Magento is thankful for any contribution that can improve our codebase, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
4141
<a href="https://magento.com/magento-contributors">
4242
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4343
</a>
@@ -48,7 +48,7 @@ Please review the [Code Contributions guide](https://devdocs.magento.com/guides/
4848

4949
## Reporting Security Issues
5050

51-
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up your issue.
51+
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up on your issue.
5252

5353
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).
5454

@@ -64,7 +64,7 @@ Please see LICENSE_EE.txt for the full text of the MEE License or visit https://
6464

6565
## Community Engineering Slack
6666

67-
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).
67+
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 a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).
6868

6969

7070
We have channels for each project. These channels are recommended for new members:

app/code/Magento/Checkout/view/frontend/templates/button.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
88

99
<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
10-
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>" target="_blank" class="print">
10+
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>"
11+
class="action print"
12+
target="_blank"
13+
rel="noopener">
1114
<?= $block->escapeHtml(__('Print receipt')) ?>
1215
</a>
1316
<?= $block->getChildHtml() ?>

app/code/Magento/ConfigurableProduct/Model/Product/Type/VariationMatrix.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\ConfigurableProduct\Model\Product\Type;
78

89
/**
10+
* Variation matrix.
11+
*
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -40,7 +43,9 @@ public function getVariations($usedProductAttributes)
4043
for ($attributeIndex = $attributesCount; $attributeIndex--;) {
4144
$currentAttribute = $variationalAttributes[$attributeIndex];
4245
$currentVariationValue = $currentVariation[$attributeIndex];
43-
$filledVariation[$currentAttribute['id']] = $currentAttribute['values'][$currentVariationValue];
46+
if (!empty($currentAttribute['id'])) {
47+
$filledVariation[$currentAttribute['id']] = $currentAttribute['values'][$currentVariationValue];
48+
}
4449
}
4550

4651
$variations[] = $filledVariation;

app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/VariationMatrixTest.php

Lines changed: 107 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,117 @@ protected function setUp()
2525
);
2626
}
2727

28-
public function testGetVariations()
28+
/**
29+
* Variations matrix test.
30+
*
31+
* @param array $expectedResult
32+
* @dataProvider variationProvider
33+
*/
34+
public function testGetVariations($expectedResult)
2935
{
30-
$result = [
31-
[
32-
130 => [
33-
'value' => '3',
34-
'label' => 'red',
35-
'price' => ['value_index' => '3', 'pricing_value' => '', 'is_percent' => '0', 'include' => '1',],
36-
],
37-
],
38-
[
39-
130 => [
40-
'value' => '4',
41-
'label' => 'blue',
42-
'price' => ['value_index' => '4', 'pricing_value' => '', 'is_percent' => '0', 'include' => '1',],
43-
],
44-
],
45-
];
4636

47-
$input = [
48-
130 => [
49-
'values' => [
50-
[
51-
'value_index' => '3',
52-
'pricing_value' => '',
53-
'is_percent' => '0',
54-
'include' => '1'
55-
],
56-
[
57-
'value_index' => '4',
58-
'pricing_value' => '',
59-
'is_percent' => '0',
60-
'include' => '1'
37+
$this->assertEquals($expectedResult['result'], $this->model->getVariations($expectedResult['input']));
38+
}
39+
40+
/**
41+
* Test data provider.
42+
*/
43+
public function variationProvider()
44+
{
45+
return [
46+
[
47+
'with_attribute_id' => [
48+
'result' => [
49+
[
50+
130 => [
51+
'value' => '3',
52+
'label' => 'red',
53+
'price' => [
54+
'value_index' => '3',
55+
'pricing_value' => '',
56+
'is_percent' => '0',
57+
'include' => '1'
58+
],
59+
],
60+
],
61+
[
62+
130 => [
63+
'value' => '4',
64+
'label' => 'blue',
65+
'price' => [
66+
'value_index' => '4',
67+
'pricing_value' => '',
68+
'is_percent' => '0',
69+
'include' => '1'
70+
],
71+
],
72+
],
6173
],
74+
'input' => [
75+
130 => [
76+
'values' => [
77+
[
78+
'value_index' => '3',
79+
'pricing_value' => '',
80+
'is_percent' => '0',
81+
'include' => '1'
82+
],
83+
[
84+
'value_index' => '4',
85+
'pricing_value' => '',
86+
'is_percent' => '0',
87+
'include' => '1'
88+
],
89+
],
90+
'attribute_id' => '130',
91+
'options' => [
92+
[
93+
'value' => '3',
94+
'label' => 'red'
95+
],
96+
['value' => '4',
97+
'label' => 'blue'
98+
]
99+
],
100+
],
101+
]
62102
],
63-
'attribute_id' => '130',
64-
'options' => [['value' => '3', 'label' => 'red',], ['value' => '4', 'label' => 'blue',],],
65-
],
103+
'without_attribute_id' => [
104+
'result' => [
105+
[
106+
130 => [
107+
'value' => '4',
108+
'label' => 'blue',
109+
'price' => [
110+
'value_index' => '4',
111+
'pricing_value' => '',
112+
'is_percent' => '0',
113+
'include' => '1'
114+
],
115+
],
116+
],
117+
],
118+
'input' => [
119+
130 => [
120+
'values' => [
121+
[
122+
'value_index' => '3',
123+
'pricing_value' => '',
124+
'is_percent' => '0',
125+
'include' => '1'
126+
]
127+
],
128+
'attribute_id' => '',
129+
'options' => [
130+
[
131+
'value' => '3',
132+
'label' => 'red'
133+
]
134+
],
135+
],
136+
]
137+
]
138+
]
66139
];
67-
68-
$this->assertEquals($result, $this->model->getVariations($input));
69140
}
70141
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest">
11+
<annotations>
12+
<features value="Customer"/>
13+
<stories value="Customer Order"/>
14+
<title value="Place an order and click print"/>
15+
<description value="Admin panel is not frozen if Storefront is opened via Customer View"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="https://github.com/magento/magento2/pull/24845"/>
18+
<group value="customer"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer" stepKey="simpleCustomer"/>
22+
<createData entity="SimpleSubCategory" stepKey="createSimpleCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
24+
<requiredEntity createDataKey="createSimpleCategory"/>
25+
</createData>
26+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="createSimpleCategory" stepKey="deleteCategory"/>
30+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
31+
<actionGroup ref="logout" stepKey="logout"/>
32+
</after>
33+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage">
34+
<argument name="customer" value="$simpleCustomer$"/>
35+
</actionGroup>
36+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct">
37+
<argument name="product" value="$createSimpleProduct$"/>
38+
</actionGroup>
39+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo">
40+
<argument name="customer" value="$simpleCustomer$"/>
41+
<argument name="address" value="US_Address_TX"/>
42+
</actionGroup>
43+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/>
44+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
45+
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/>
46+
47+
<actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/>
48+
<actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/>
49+
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/>
50+
<actionGroup ref="submitShipmentIntoOrder" stepKey="submitShipment"/>
51+
52+
<!--Create Credit Memo-->
53+
<actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo">
54+
<argument name="orderId" value="{$getOrderId}"/>
55+
</actionGroup>
56+
<actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/>
57+
58+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInCustomer">
59+
<argument name="Customer" value="$$simpleCustomer$$"/>
60+
</actionGroup>
61+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToMyOrdersPage">
62+
<argument name="menu" value="My Orders"/>
63+
</actionGroup>
64+
<click selector="{{StorefrontCustomerOrderSection.viewOrder}}" stepKey="clickViewOrder"/>
65+
<click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/>
66+
<waitForPageLoad stepKey="waitPageReload"/>
67+
<switchToWindow stepKey="switchToWindow"/>
68+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
69+
70+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBook">
71+
<argument name="menu" value="Address Book"/>
72+
</actionGroup>
73+
<see selector="{{CheckoutOrderSummarySection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}} {{US_Address_TX.city}}, {{US_Address_TX.state}}, {{US_Address_TX.postcode}}" stepKey="checkShippingAddress"/>
74+
</test>
75+
</tests>

app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items.phtml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
<?php $_order = $block->getOrder() ?>
88
<div class="actions-toolbar">
99
<a href="<?= $block->escapeUrl($block->getPrintAllCreditmemosUrl($_order)) ?>"
10-
onclick="this.target='_blank'"
11-
class="action print">
10+
class="action print"
11+
target="_blank"
12+
rel="noopener">
1213
<span><?= $block->escapeHtml(__('Print All Refunds')) ?></span>
1314
</a>
1415
</div>
1516
<?php foreach ($_order->getCreditmemosCollection() as $_creditmemo) : ?>
1617
<div class="order-title">
1718
<strong><?= $block->escapeHtml(__('Refund #')) ?><?= $block->escapeHtml($_creditmemo->getIncrementId()) ?> </strong>
1819
<a href="<?= $block->escapeUrl($block->getPrintCreditmemoUrl($_creditmemo)) ?>"
19-
onclick="this.target='_blank'"
20-
class="action print">
20+
class="action print"
21+
target="_blank"
22+
rel="noopener">
2123
<span><?= $block->escapeHtml(__('Print Refund')) ?></span>
2224
</a>
2325
</div>

app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
<span><?= $block->escapeHtml(__('Reorder')) ?></span>
1717
</a>
1818
<?php endif ?>
19-
<a class="action print"
20-
href="<?= $block->escapeUrl($block->getPrintUrl($_order)) ?>"
21-
onclick="this.target='_blank';">
19+
<a href="<?= $block->escapeUrl($block->getPrintUrl($_order)) ?>"
20+
class="action print"
21+
target="_blank"
22+
rel="noopener">
2223
<span><?= $block->escapeHtml(__('Print Order')) ?></span>
2324
</a>
2425
<?= $block->getChildHtml() ?>

app/code/Magento/Sales/view/frontend/templates/order/invoice/items.phtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
<?php $_order = $block->getOrder() ?>
88
<div class="actions-toolbar">
99
<a href="<?= $block->escapeUrl($block->getPrintAllInvoicesUrl($_order)) ?>"
10+
class="action print"
1011
target="_blank"
11-
class="action print">
12+
rel="noopener">
1213
<span><?= $block->escapeHtml(__('Print All Invoices')) ?></span>
1314
</a>
1415
</div>
1516
<?php foreach ($_order->getInvoiceCollection() as $_invoice) : ?>
1617
<div class="order-title">
1718
<strong><?= $block->escapeHtml(__('Invoice #')) ?><?= $block->escapeHtml($_invoice->getIncrementId()) ?></strong>
1819
<a href="<?= $block->escapeUrl($block->getPrintInvoiceUrl($_invoice)) ?>"
19-
onclick="this.target='_blank'"
20-
class="action print">
20+
class="action print"
21+
target="_blank"
22+
rel="noopener">
2123
<span><?= $block->escapeHtml(__('Print Invoice')) ?></span>
2224
</a>
2325
</div>

0 commit comments

Comments
 (0)