Skip to content

Commit 8c54bd6

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MC-23215
2 parents 08f30d0 + 0887683 commit 8c54bd6

File tree

744 files changed

+30526
-5033
lines changed

Some content is hidden

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

744 files changed

+30526
-5033
lines changed

app/code/Magento/Analytics/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<label>Advanced Reporting</label>
1616
<comment><![CDATA[This service provides a dynamic suite of reports with rich insights about your business.
1717
Your reports can be accessed securely on a personalized dashboard outside of the admin panel by clicking on the
18-
"Go to Advanced Reporting" link. </br> For more information, see our <a href="https://magento.com/legal/terms/cloud-terms">
18+
"Go to Advanced Reporting" link. </br> For more information, see our <a target="_blank" href="https://magento.com/legal/terms/cloud-terms">
1919
terms and conditions</a>.]]></comment>
2020
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
2121
<label>Advanced Reporting Service</label>

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ public function getData(array $data): array
4949
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
5050
);
5151
}
52-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
53-
throw new GraphQlInputException(
54-
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
55-
);
56-
}
57-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
58-
throw new GraphQlInputException(
59-
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
60-
);
61-
}
62-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
63-
throw new GraphQlInputException(
64-
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
65-
);
66-
}
6752

6853
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
6954
foreach ($additionalData as $key => $value) {

app/code/Magento/Backend/Block/Media/Uploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function _construct()
8787

8888
$this->setId($this->getId() . '_Uploader');
8989

90-
$uploadUrl = $this->_urlBuilder->addSessionParam()->getUrl('adminhtml/*/upload');
90+
$uploadUrl = $this->_urlBuilder->getUrl('adminhtml/*/upload');
9191
$this->getConfig()->setUrl($uploadUrl);
9292
$this->getConfig()->setParams(['form_key' => $this->getFormKey()]);
9393
$this->getConfig()->setFileField('file');

app/code/Magento/Backend/Model/Menu/Item/Validator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
namespace Magento\Backend\Model\Menu\Item;
77

88
/**
9+
* Class Validator
10+
*
11+
* @package Magento\Backend\Model\Menu\Item
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -49,7 +52,7 @@ public function __construct()
4952

5053
$attributeValidator = new \Zend_Validate();
5154
$attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
52-
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_]+$/'));
55+
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/'));
5356

5457
$textValidator = new \Zend_Validate_StringLength(['min' => 3, 'max' => 50]);
5558

@@ -101,6 +104,7 @@ private function checkMenuItemIsRemoved($data)
101104

102105
/**
103106
* Check that menu item contains all required data
107+
*
104108
* @param array $data
105109
*
106110
* @throws \BadMethodCallException

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
' resource="Test_Value::value"/></menu></config>',
1111
[
1212
"Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
13-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
13+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
1414
"Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
1515
],
1616
],
@@ -20,7 +20,7 @@
2020
'resource="Test_Value::value"/></menu></config>',
2121
[
2222
"Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " .
23-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
23+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
2424
"Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
2525
],
2626
],
@@ -31,7 +31,7 @@
3131
'</menu></config>',
3232
[
3333
"Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " .
34-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
34+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
3535
"Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " .
3636
"type 'typeAction'.\nLine: 1\n"
3737
],
@@ -452,7 +452,7 @@
452452
'<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>',
453453
[
454454
"Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
455-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
455+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
456456
"Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
457457
],
458458
],
@@ -462,7 +462,7 @@
462462
'resource="Test_Value::value"/></menu></config>',
463463
[
464464
"Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " .
465-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
465+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
466466
"Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
467467
],
468468
],
@@ -471,7 +471,7 @@
471471
'id="Test_Value::some_value"/></menu></config>',
472472
[
473473
"Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " .
474-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
474+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
475475
"Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" .
476476
" type 'typeAction'.\nLine: 1\n"
477477
],

app/code/Magento/Backend/etc/menu.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</xs:documentation>
101101
</xs:annotation>
102102
<xs:restriction base="xs:string">
103-
<xs:pattern value="[a-zA-Z0-9/_]{3,}" />
103+
<xs:pattern value="[a-zA-Z0-9/_\-]{3,}" />
104104
</xs:restriction>
105105
</xs:simpleType>
106106

app/code/Magento/Backend/view/adminhtml/web/js/translate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ define([
3535
* @return {String}
3636
*/
3737
this.translate = function (text) {
38-
return _data[text] ? _data[text] : text;
38+
return typeof _data[text] === 'string' ? _data[text] : text;
3939
};
4040

4141
return this;

app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@ public function getData(array $args): array
3131
__('Required parameter "braintree" for "payment_method" is missing.')
3232
);
3333
}
34-
35-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['payment_method_nonce'])) {
36-
throw new GraphQlInputException(
37-
__('Required parameter "payment_method_nonce" for "braintree" is missing.')
38-
);
39-
}
40-
41-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['is_active_payment_token_enabler'])) {
42-
throw new GraphQlInputException(
43-
__('Required parameter "is_active_payment_token_enabler" for "braintree" is missing.')
44-
);
45-
}
46-
4734
return $args[self::PATH_ADDITIONAL_DATA];
4835
}
4936
}

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AbstractModifierTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ protected function setUp()
4545
$this->locatorMock = $this->getMockBuilder(LocatorInterface::class)
4646
->getMockForAbstractClass();
4747
$this->productMock = $this->getMockBuilder(ProductInterface::class)
48+
->setMethods(['getPriceType'])
4849
->getMockForAbstractClass();
4950

5051
$this->locatorMock->expects($this->any())
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Bundle\Test\Unit\Ui\DataProvider\Product\Form\Modifier;
7+
8+
use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice;
9+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
10+
use Magento\Framework\Stdlib\ArrayManager;
11+
12+
class BundlePriceTest extends AbstractModifierTest
13+
{
14+
/**
15+
* @return BundlePrice
16+
*/
17+
protected function createModel()
18+
{
19+
return $this->objectManager->getObject(
20+
BundlePrice::class,
21+
[
22+
'locator' => $this->locatorMock,
23+
'arrayManager' => $this->arrayManagerMock
24+
]
25+
);
26+
}
27+
28+
/**
29+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
30+
*/
31+
public function testModifyMeta()
32+
{
33+
$this->productMock->expects($this->any())
34+
->method('getId')
35+
->willReturn(true);
36+
$this->productMock->expects($this->any())
37+
->method('getPriceType')
38+
->willReturn(0);
39+
$priceTypePath = 'bundle-items/children/' . BundlePrice::CODE_PRICE_TYPE;
40+
$priceTypeConfigPath = $priceTypePath . BundlePrice::META_CONFIG_PATH;
41+
$pricePath = 'product-details/children/' . ProductAttributeInterface::CODE_PRICE;
42+
$priceConfigPath = $pricePath . BundlePrice::META_CONFIG_PATH;
43+
$sourceMeta = [
44+
'bundle-items' => [
45+
'children' => [
46+
BundlePrice::CODE_PRICE_TYPE => []
47+
]
48+
]
49+
];
50+
$priceTypeParams = [
51+
'disabled' => true,
52+
'valueMap' => [
53+
'false' => '1',
54+
'true' => '0'
55+
],
56+
'validation' => [
57+
'required-entry' => false
58+
]
59+
];
60+
$priceTypeMeta = [
61+
'bundle-items' => [
62+
'children' => [
63+
BundlePrice::CODE_PRICE_TYPE => $priceTypeParams
64+
]
65+
]
66+
];
67+
$priceParams = [
68+
'imports' => [
69+
'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
70+
]
71+
];
72+
$priceMeta = [
73+
'product-details' => [
74+
'children' => [
75+
BundlePrice::CODE_PRICE_TYPE => []
76+
]
77+
],
78+
'bundle-items' => [
79+
'children' => [
80+
ProductAttributeInterface::CODE_PRICE => $priceParams
81+
]
82+
]
83+
];
84+
$taxParams = [
85+
'service' => [
86+
'template' => ''
87+
]
88+
];
89+
90+
$this->arrayManagerMock->expects(static::any())
91+
->method('findPath')
92+
->willReturnMap(
93+
[
94+
[
95+
BundlePrice::CODE_PRICE_TYPE,
96+
$sourceMeta,
97+
null,
98+
'children',
99+
ArrayManager::DEFAULT_PATH_DELIMITER,
100+
$priceTypePath
101+
],
102+
[
103+
ProductAttributeInterface::CODE_PRICE,
104+
$priceTypeMeta,
105+
BundlePrice::DEFAULT_GENERAL_PANEL . '/children',
106+
'children',
107+
ArrayManager::DEFAULT_PATH_DELIMITER,
108+
$pricePath
109+
],
110+
[
111+
BundlePrice::CODE_TAX_CLASS_ID,
112+
$priceMeta,
113+
null,
114+
'children',
115+
ArrayManager::DEFAULT_PATH_DELIMITER,
116+
$pricePath
117+
],
118+
[
119+
BundlePrice::CODE_TAX_CLASS_ID,
120+
$priceMeta,
121+
null,
122+
'children',
123+
ArrayManager::DEFAULT_PATH_DELIMITER,
124+
$pricePath
125+
]
126+
]
127+
);
128+
$this->arrayManagerMock->expects($this->exactly(4))
129+
->method('merge')
130+
->willReturnMap(
131+
[
132+
[
133+
$priceTypeConfigPath,
134+
$sourceMeta,
135+
$priceTypeParams,
136+
ArrayManager::DEFAULT_PATH_DELIMITER,
137+
$priceTypeMeta
138+
],
139+
[
140+
$priceConfigPath,
141+
$priceTypeMeta,
142+
$priceParams,
143+
ArrayManager::DEFAULT_PATH_DELIMITER,
144+
$priceMeta
145+
],
146+
[
147+
$priceConfigPath,
148+
$priceMeta,
149+
$priceParams,
150+
ArrayManager::DEFAULT_PATH_DELIMITER,
151+
$priceMeta
152+
],
153+
[
154+
$priceConfigPath,
155+
$priceMeta,
156+
$taxParams,
157+
ArrayManager::DEFAULT_PATH_DELIMITER,
158+
$priceMeta
159+
]
160+
]
161+
);
162+
163+
$this->assertSame($priceMeta, $this->getModel()->modifyMeta($sourceMeta));
164+
}
165+
166+
public function testModifyData()
167+
{
168+
$expectedData = [];
169+
$this->assertEquals($expectedData, $this->getModel()->modifyData($expectedData));
170+
}
171+
}

0 commit comments

Comments
 (0)