Skip to content

Commit 88b844e

Browse files
merge magento/2.4-develop into magento-engcom/login-as-customer-150
2 parents 0e1b849 + d822601 commit 88b844e

File tree

12 files changed

+461
-212
lines changed

12 files changed

+461
-212
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
*/
66

77
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
8+
$blockId = $block->getId();
89
?>
9-
<div id="product_composite_configure" class="product-configure-popup">
10+
<div id="product_composite_configure"
11+
class="product-configure-popup product-configure-popup-<?= $block->escapeHtmlAttr($blockId) ?>">
1012
<iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe"></iframe>
1113
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
1214
'onload',
@@ -31,40 +33,45 @@
3133
</form>
3234
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
3335
'onsubmit',
34-
"productConfigure.onConfirmBtn();event.preventDefault()",
36+
'productConfigure.onConfirmBtn();event.preventDefault()',
3537
'.product_composite_configure_form:last-of-type'
3638
) ?>
3739

3840
<div id="product_composite_configure_confirmed" class="product_composite_configure_confirmed"></div>
3941

4042
<?php $scriptString = <<<script
41-
prodCompConfIframe = document.querySelector("iframe[name='product_composite_configure_iframe']:last-of-type");
43+
prodCompConfIframe = document.querySelector(
44+
".product-configure-popup-$blockId iframe[name='product_composite_configure_iframe']"
45+
);
4246
prodCompConfIframe.style.width = 0;
4347
prodCompConfIframe.style.height = 0;
4448
prodCompConfIframe.style.border = "0px solid #fff";
4549
prodCompConfIframe.style.position = "absolute";
4650
prodCompConfIframe.style.top = "-1000px";
4751
prodCompConfIframe.style.left = "-1000px";
48-
prodCompConfMessages = document.querySelectorAll(".product_composite_configure_messages");
49-
for (var i = 0; i < prodCompConfMessages.length; i++) {
50-
prodCompConfMessages[i].style.display = "none";
51-
}
52-
prodCompConfFormAdd = document.querySelectorAll(".product_composite_configure_form_additional");
53-
for (var i = 0; i < prodCompConfFormAdd.length; i++) {
54-
prodCompConfFormAdd[i].style.display = "none";
55-
}
56-
prodCompConfFormConf = document.querySelectorAll(".product_composite_configure_form_confirmed");
57-
for (var i = 0; i < prodCompConfFormConf.length; i++) {
58-
prodCompConfFormConf[i].style.display = "none";
59-
}
60-
prodCompConfConf = document.querySelectorAll(".product_composite_configure_confirmed");
61-
for (var i = 0; i < prodCompConfConf.length; i++) {
62-
prodCompConfConf[i].style.display = "none";
63-
}
64-
prodConfPopup = document.querySelectorAll(".product-configure-popup");
65-
for (var i = 0; i < prodConfPopup.length; i++) {
66-
prodConfPopup[i].style.display = "none";
67-
}
52+
53+
prodCompConfMessages = document.querySelector(
54+
".product-configure-popup-$blockId .product_composite_configure_messages"
55+
);
56+
prodCompConfMessages.style.display = "none";
57+
58+
prodCompConfFormAdd = document.querySelector(
59+
".product-configure-popup-$blockId .product_composite_configure_form_additional"
60+
);
61+
prodCompConfFormAdd.style.display = "none";
62+
63+
prodCompConfFormConf = document.querySelector(
64+
".product-configure-popup-$blockId .product_composite_configure_form_confirmed"
65+
);
66+
prodCompConfFormConf.style.display = "none";
67+
68+
prodCompConfConf = document.querySelector(
69+
".product-configure-popup-$blockId .product_composite_configure_confirmed"
70+
);
71+
prodCompConfConf.style.display = "none";
72+
73+
prodConfPopup = document.querySelector(".product-configure-popup-$blockId");
74+
prodConfPopup.style.display = "none";
6875
6976
require([
7077
"jquery",

app/code/Magento/Paypal/Model/AbstractConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class AbstractConfig implements ConfigInterface
5858
/**
5959
* @var string
6060
*/
61-
private static $bnCode = 'Magento_Cart_%s';
61+
private static $bnCode = 'Magento_2_%s';
6262

6363
/**
6464
* @var \Magento\Framework\App\Config\ScopeConfigInterface

app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
1717

18+
/**
19+
* Test for \Magento\Paypal\Model\AbstractConfig
20+
*/
1821
class AbstractConfigTest extends TestCase
1922
{
2023

@@ -353,7 +356,7 @@ public function testGetBuildNotationCode()
353356
$productMetadata
354357
);
355358

356-
self::assertEquals('Magento_Cart_SomeEdition', $this->config->getBuildNotationCode());
359+
self::assertEquals('Magento_2_SomeEdition', $this->config->getBuildNotationCode());
357360
}
358361

359362
/**

dev/tests/integration/testsuite/Magento/Paypal/Model/Api/NvpTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testRequestTotalsAndLineItemsWithFPT()
9595
. '&SHIPPINGAMT=0.00&ITEMAMT=112.70&TAXAMT=0.00'
9696
. '&L_NAME0=Simple+Product+FPT&L_QTY0=1&L_AMT0=100.00'
9797
. '&L_NAME1=FPT&L_QTY1=1&L_AMT1=12.70'
98-
. '&METHOD=SetExpressCheckout&VERSION=72.0&BUTTONSOURCE=Magento_Cart_';
98+
. '&METHOD=SetExpressCheckout&VERSION=72.0&BUTTONSOURCE=Magento_2_';
9999

100100
$this->httpClient->method('write')
101101
->with(
@@ -146,7 +146,7 @@ public function testCallRefundTransaction()
146146

147147
$httpQuery = 'TRANSACTIONID=fooTransactionId&REFUNDTYPE=Partial'
148148
.'&CURRENCYCODE=USD&AMT=145.98&METHOD=RefundTransaction'
149-
.'&VERSION=72.0&BUTTONSOURCE=Magento_Cart_';
149+
.'&VERSION=72.0&BUTTONSOURCE=Magento_2_';
150150

151151
$this->httpClient->expects($this->once())->method('write')
152152
->with(

dev/tests/integration/testsuite/Magento/Paypal/Model/Api/PayflowNvpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testRequestLineItems()
9595
. 'L_NAME1=Simple 2&L_QTY1=2&L_COST1=9.69&'
9696
. 'L_NAME2=Simple 3&L_QTY2=3&L_COST2=11.69&'
9797
. 'L_NAME3=Discount&L_QTY3=1&L_COST3=-10.00&'
98-
. 'TRXTYPE=A&ACTION=S&BUTTONSOURCE=Magento_Cart_';
98+
. 'TRXTYPE=A&ACTION=S&BUTTONSOURCE=Magento_2_';
9999

100100
$this->httpClient->method('write')
101101
->with(

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ public function testResolvePlaceOrderWithPayflowLinkForCustomer(): void
119119
cart_id: "$cartId"
120120
payment_method: {
121121
code: "$paymentMethod"
122-
payflow_link:
122+
payflow_link:
123123
{
124124
cancel_url:"paypal/payflow/cancelPayment"
125125
return_url:"paypal/payflow/returnUrl"
126126
error_url:"paypal/payflow/errorUrl"
127127
}
128128
}
129-
}) {
129+
}) {
130130
cart {
131131
selected_payment_method {
132132
code
@@ -142,7 +142,7 @@ public function testResolvePlaceOrderWithPayflowLinkForCustomer(): void
142142
QUERY;
143143

144144
$productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
145-
$button = 'Magento_Cart_' . $productMetadata->getEdition();
145+
$button = 'Magento_2_' . $productMetadata->getEdition();
146146

147147
$payflowLinkResponse = new DataObject(
148148
[

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Guest/PlaceOrderWithPayflowLinkTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ public function testResolvePlaceOrderWithPayflowLink(): void
117117
cart_id: "$cartId"
118118
payment_method: {
119119
code: "$paymentMethod"
120-
payflow_link:
120+
payflow_link:
121121
{
122122
cancel_url:"paypal/payflow/cancel"
123123
return_url:"paypal/payflow/return"
124124
error_url:"paypal/payflow/error"
125125
}
126126
}
127-
}) {
127+
}) {
128128
cart {
129129
selected_payment_method {
130130
code
@@ -140,7 +140,7 @@ public function testResolvePlaceOrderWithPayflowLink(): void
140140
QUERY;
141141

142142
$productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
143-
$button = 'Magento_Cart_' . $productMetadata->getEdition();
143+
$button = 'Magento_2_' . $productMetadata->getEdition();
144144

145145
$payflowLinkResponse = new DataObject(
146146
[
@@ -219,14 +219,14 @@ public function testResolveWithPayflowLinkDeclined(): void
219219
cart_id: "$cartId"
220220
payment_method: {
221221
code: "$paymentMethod"
222-
payflow_link:
222+
payflow_link:
223223
{
224224
cancel_url:"paypal/payflow/cancelPayment"
225225
return_url:"paypal/payflow/returnUrl"
226226
error_url:"paypal/payflow/returnUrl"
227227
}
228228
}
229-
}) {
229+
}) {
230230
cart {
231231
selected_payment_method {
232232
code

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Guest/PlaceOrderWithPaymentsAdvancedTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function testResolvePlaceOrderWithPaymentsAdvanced(): void
108108
$cartId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
109109

110110
$productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
111-
$button = 'Magento_Cart_' . $productMetadata->getEdition();
111+
$button = 'Magento_2_' . $productMetadata->getEdition();
112112

113113
$payflowLinkResponse = new DataObject(
114114
[
@@ -256,7 +256,7 @@ private function setPaymentMethodAndPlaceOrder(string $cartId, string $paymentMe
256256
error_url:"paypal/payflowadvanced/customerror"
257257
}
258258
}
259-
}) {
259+
}) {
260260
cart {
261261
selected_payment_method {
262262
code
@@ -300,7 +300,7 @@ private function setPaymentMethodWithInValidUrl(string $cartId, string $paymentM
300300
error_url:"paypal/payflowadvanced/error"
301301
}
302302
}
303-
}) {
303+
}) {
304304
cart {
305305
selected_payment_method {
306306
code

dev/tests/integration/testsuite/Magento/PaypalGraphQl/_files/paypal_place_order_request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$notifyUrl = $url->getUrl('paypal/ipn/');
1414

1515
$productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
16-
$button = 'Magento_Cart_' . $productMetadata->getEdition();
16+
$button = 'Magento_2_' . $productMetadata->getEdition();
1717

1818
return [
1919
'TOKEN' => $token,

dev/tests/static/framework/Magento/TestFramework/Dependency/PhpRule.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ private function caseClassesAndIdentifiers($currentModule, $file, &$contents)
167167
'[_\\\\]|',
168168
Files::init()->getNamespaces()
169169
)
170-
. '[_\\\\])[a-zA-Z0-9]+)'
171-
. '(?<class_inside_module>[a-zA-Z0-9_\\\\]*))\b(?:::(?<module_scoped_key>[a-z0-9_]+)[\'"])?~';
170+
. '(?<delimiter>[_\\\\]))[a-zA-Z0-9]{2,})'
171+
. '(?<class_inside_module>\\4[a-zA-Z0-9_\\\\]{2,})?)\b'
172+
. '(?:::(?<module_scoped_key>[A-Za-z0-9_/.]+)[\'"])?~';
172173

173174
if (!preg_match_all($pattern, $contents, $matches)) {
174175
return [];

0 commit comments

Comments
 (0)