Skip to content

Commit b82a164

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into MC-19245
2 parents 50101f1 + e56640c commit b82a164

File tree

20 files changed

+198
-64
lines changed

20 files changed

+198
-64
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

app/code/Magento/AdminNotification/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,25 @@ The Magento_AdminNotification module provides the ability to alert administrator
44

55
## Installation details
66

7+
The Magento_AdminNotification module creates the following tables in the database:
8+
- `adminnotification_inbox`
9+
- `admin_system_messages`
10+
711
Before disabling or uninstalling this module, note that the Magento_Indexer module depends on this module.
812

913
For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).
1014

15+
## Extensibility
16+
17+
Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
18+
19+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module.
20+
1121
### Events
1222

1323
This module observes the following events:
1424

15-
- `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver`
25+
- `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file.
1626

1727
### Layouts
1828

app/code/Magento/AdvancedPricingImportExport/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22

33
The Magento_AdvancedPricingImportExport module handles the import and export of the advanced pricing.
44

5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_AdvancedPricingImportExport module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedPricingImportExport module.

app/code/Magento/Amqp/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
# Amqp
1+
# Magento_Amqp module
22

3-
**Amqp** provides functionality to publish/consume messages with Amqp.
3+
Magento_Amqp module provides functionality to publish/consume messages with the Advanced Message Queuing Protocol (AMQP).
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_Amqp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Amqp module.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@
536536
<label>Enable HTTP Strict Transport Security (HSTS)</label>
537537
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
538538
<backend_model>Magento\Config\Model\Config\Backend\Secure</backend_model>
539-
<comment><![CDATA[See <a href="https://www.owasp.org/index.php/HTTP_Strict_Transport_Security" target="_blank">HTTP Strict Transport Security</a> page for details.]]></comment>
539+
<comment><![CDATA[See <a href="https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Strict_Transport_Security_Cheat_Sheet.html" target="_blank">HTTP Strict Transport Security</a> page for details.]]></comment>
540540
<depends>
541541
<field id="use_in_frontend">1</field>
542542
<field id="use_in_adminhtml">1</field>

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
<settings>
350350
<validation>
351351
<rule name="required-entry" xsi:type="boolean">true</rule>
352+
<rule name="validate-number" xsi:type="boolean">true</rule>
352353
</validation>
353354
<additionalClasses>
354355
<class name="admin__field-small">true</class>

app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
<description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description>
6262
</annotations>
6363
<click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/>
64-
<acceptPopup after="deleteTemplate" stepKey="acceptPopup"/>
64+
<waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/>
65+
<click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/>
6566
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" after="acceptPopup" stepKey="waitForSuccessMessage"/>
6667
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/>
6768
</actionGroup>

app/code/Magento/Email/Test/Mftf/Section/AdminEmailTemplateEditSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="loadTemplateButton" type="button" selector="#load" timeout="30"/>
1717
<element name="deleteTemplateButton" type="button" selector="#delete"/>
1818
<element name="previewTemplateButton" type="button" selector="#preview" timeout="30"/>
19+
<element name="acceptPopupButton" type="button" selector=".action-accept" />
1920
</section>
2021
</sections>

app/code/Magento/Email/view/adminhtml/templates/template/edit.phtml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ require([
6161
"jquery",
6262
"wysiwygAdapter",
6363
"Magento_Ui/js/modal/alert",
64+
'Magento_Ui/js/modal/confirm',
6465
"mage/mage",
6566
"Magento_Email/js/variables",
6667
"prototype"
67-
], function(jQuery, tinyMCE, alert){
68+
], function(jQuery, tinyMCE, alert, confirm){
6869

6970
//<![CDATA[
7071
jQuery('#email_template_edit_form').mage('form').mage('validation');
@@ -113,18 +114,22 @@ require([
113114
},
114115

115116
stripTags: function () {
116-
if(!window.confirm("<?= $block->escapeJs($block->escapeHtml(__('Are you sure you want to strip tags?'))) ?>")) {
117-
return false;
118-
}
119-
this.unconvertedText = $('template_text').value;
120-
$('convert_button').hide();
121-
$('template_text').value = $('template_text').value.stripScripts().replace(
122-
new RegExp('<style[^>]*>[\\S\\s]*?</style>', 'img'), ''
123-
).stripTags().strip();
124-
$('convert_button_back').show();
125-
$('field_template_styles').hide();
126-
this.typeChange = true;
127-
return false;
117+
confirm({
118+
content: "<?= $block->escapeJs($block->escapeHtml(__('Are you sure you want to strip tags?'))) ?>",
119+
actions: {
120+
confirm: function () {
121+
this.unconvertedText = $('template_text').value;
122+
$('convert_button').hide();
123+
$('template_text').value = $('template_text').value.stripScripts().replace(
124+
new RegExp('<style[^>]*>[\\S\\s]*?</style>', 'img'), ''
125+
).stripTags().strip();
126+
$('convert_button_back').show();
127+
$('field_template_styles').hide();
128+
this.typeChange = true;
129+
return false;
130+
}
131+
}
132+
});
128133
},
129134
unStripTags: function () {
130135
$('convert_button').show();
@@ -164,9 +169,14 @@ require([
164169
},
165170

166171
deleteTemplate: function() {
167-
if(window.confirm("<?= $block->escapeJs($block->escapeHtml(__('Are you sure you want to delete this template?'))) ?>")) {
168-
window.location.href = '<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>';
169-
}
172+
confirm({
173+
content: "<?= $block->escapeJs($block->escapeHtml(__('Are you sure you want to delete this template?'))) ?>",
174+
actions: {
175+
confirm: function () {
176+
window.location.href = '<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>';
177+
}
178+
}
179+
});
170180
},
171181

172182
load: function() {

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,58 @@
1616
<field id="customer" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1717
<label>Customer Token Lifetime (hours)</label>
1818
<comment>We will disable this feature if the value is empty.</comment>
19+
<validate>required-entry validate-zero-or-greater validate-number</validate>
1920
</field>
2021
<field id="admin" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2122
<label>Admin Token Lifetime (hours)</label>
2223
<comment>We will disable this feature if the value is empty.</comment>
24+
<validate>required-entry validate-zero-or-greater validate-number</validate>
2325
</field>
2426
</group>
2527
<group id="cleanup" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="0" showInStore="0">
2628
<label>Cleanup Settings</label>
2729
<field id="cleanup_probability" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2830
<label>Cleanup Probability</label>
2931
<comment>Integer. Launch cleanup in X OAuth requests. 0 (not recommended) - to disable cleanup</comment>
32+
<validate>required-entry validate-zero-or-greater validate-digits</validate>
3033
</field>
3134
<field id="expiration_period" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
3235
<label>Expiration Period</label>
3336
<comment>Cleanup entries older than X minutes.</comment>
37+
<validate>required-entry validate-zero-or-greater validate-number</validate>
3438
</field>
3539
</group>
3640
<group id="consumer" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="0" showInStore="0">
3741
<label>Consumer Settings</label>
3842
<field id="expiration_period" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
3943
<label>Expiration Period</label>
4044
<comment>Consumer key/secret will expire if not used within X seconds after Oauth token exchange starts.</comment>
45+
<validate>required-entry validate-zero-or-greater validate-number</validate>
4146
</field>
4247
<field id="post_maxredirects" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
4348
<label>OAuth consumer credentials HTTP Post maxredirects</label>
4449
<comment>Number of maximum redirects for OAuth consumer credentials Post request.</comment>
50+
<validate>required-entry validate-zero-or-greater validate-digits</validate>
4551
</field>
4652
<field id="post_timeout" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
4753
<label>OAuth consumer credentials HTTP Post timeout</label>
4854
<comment>Timeout for OAuth consumer credentials Post request within X seconds.</comment>
55+
<validate>required-entry validate-zero-or-greater validate-number</validate>
4956
</field>
5057
</group>
5158
<group id="authentication_lock" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="0" showInStore="0">
5259
<label>Authentication Locks</label>
5360
<field id="max_failures_count" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
5461
<label>Maximum Login Failures to Lock Out Account</label>
5562
<comment>Maximum Number of authentication failures to lock out account.</comment>
63+
<validate>required-entry validate-zero-or-greater validate-digits</validate>
5664
</field>
5765
<field id="timeout" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
5866
<label>Lockout Time (seconds)</label>
5967
<comment>Period of time in seconds after which account will be unlocked.</comment>
68+
<validate>required-entry validate-zero-or-greater validate-number</validate>
6069
</field>
6170
</group>
62-
6371
</section>
6472
</system>
6573
</config>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function isMethodActive($method)
293293
case Config::METHOD_WPS_BML:
294294
case Config::METHOD_WPP_BML:
295295
$disabledFunding = $this->_scopeConfig->getValue(
296-
'payment/paypal_express/disable_funding_options',
296+
'paypal/style/disable_funding_options',
297297
ScopeInterface::SCOPE_STORE,
298298
$this->_storeId
299299
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public function testIsMethodActiveBml($disableFundingOptions, $expectedFlag, $ex
306306
{
307307
$this->scopeConfigMock->method('getValue')
308308
->with(
309-
self::equalTo('payment/paypal_express/disable_funding_options'),
309+
self::equalTo('paypal/style/disable_funding_options'),
310310
self::equalTo('store')
311311
)
312312
->willReturn($disableFundingOptions);

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

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Store\Model\ScopeInterface;
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111

12+
/**
13+
* Class ConfigTest
14+
*/
1215
class ConfigTest extends \PHPUnit\Framework\TestCase
1316
{
1417
/**
@@ -122,7 +125,7 @@ public function testIsMethodAvailableForIsMethodActive($methodName, $expected)
122125
$valueMap = [
123126
['paypal/general/merchant_country', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, 'US'],
124127
['paypal/general/merchant_country', ScopeInterface::SCOPE_STORE, null, 'US'],
125-
['payment/paypal_express/disable_funding_options', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, []],
128+
['paypal/style/disable_funding_options', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, []],
126129
];
127130
$this->scopeConfig
128131
->method('getValue')
@@ -362,11 +365,15 @@ public function testGetBmlDisplay($section, $expectedValue, $expectedFlag, $expe
362365
->will($this->returnValue($expectedFlag));
363366
$this->scopeConfig->expects($this->any())
364367
->method('getValue')
365-
->will($this->returnValueMap([
366-
['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue],
367-
['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue],
368-
['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue],
369-
]));
368+
->will(
369+
$this->returnValueMap(
370+
[
371+
['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue],
372+
['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue],
373+
['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue],
374+
]
375+
)
376+
);
370377
$this->assertEquals($expected, $this->model->getBmlDisplay($section));
371378
}
372379

@@ -407,11 +414,13 @@ public function testGetExpressCheckoutShortcutImageUrl(
407414

408415
$this->scopeConfig->expects($this->any())
409416
->method('getValue')
410-
->willReturnMap([
411-
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
412-
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
413-
['paypal/wpp/button_type', ScopeInterface::SCOPE_STORE, 123, $buttonType],
414-
]);
417+
->willReturnMap(
418+
[
419+
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
420+
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
421+
['paypal/wpp/button_type', ScopeInterface::SCOPE_STORE, 123, $buttonType],
422+
]
423+
);
415424

416425
$this->assertEquals(
417426
$result,
@@ -475,10 +484,12 @@ public function testGetPaymentMarkImageUrl(
475484

476485
$this->scopeConfig->expects($this->any())
477486
->method('getValue')
478-
->willReturnMap([
479-
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
480-
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
481-
]);
487+
->willReturnMap(
488+
[
489+
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
490+
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
491+
]
492+
);
482493

483494
$this->assertEquals(
484495
$result,

app/code/Magento/Store/Model/System/Store.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Store\Model\System;
710

811
use Magento\Framework\Data\OptionSourceInterface;
@@ -118,6 +121,7 @@ public function getStoreValuesForForm($empty = false, $all = false)
118121
$options[] = ['label' => __('All Store Views'), 'value' => 0];
119122
}
120123

124+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
121125
$nonEscapableNbspChar = html_entity_decode('&#160;', ENT_NOQUOTES, 'UTF-8');
122126

123127
foreach ($this->_websiteCollection as $website) {
@@ -126,7 +130,7 @@ public function getStoreValuesForForm($empty = false, $all = false)
126130
if ($website->getId() != $group->getWebsiteId()) {
127131
continue;
128132
}
129-
$groupShow = false;
133+
$values = [];
130134
foreach ($this->_storeCollection as $store) {
131135
if ($group->getId() != $store->getGroupId()) {
132136
continue;
@@ -135,16 +139,12 @@ public function getStoreValuesForForm($empty = false, $all = false)
135139
$options[] = ['label' => $website->getName(), 'value' => []];
136140
$websiteShow = true;
137141
}
138-
if (!$groupShow) {
139-
$groupShow = true;
140-
$values = [];
141-
}
142142
$values[] = [
143143
'label' => str_repeat($nonEscapableNbspChar, 4) . $store->getName(),
144144
'value' => $store->getId(),
145145
];
146146
}
147-
if ($groupShow) {
147+
if (!empty($values)) {
148148
$options[] = [
149149
'label' => str_repeat($nonEscapableNbspChar, 4) . $group->getName(),
150150
'value' => $values,
@@ -398,6 +398,7 @@ public function getStoreCollection()
398398

399399
/**
400400
* Load/Reload collection(s) by type
401+
*
401402
* Allowed types: website, group, store or null for all
402403
*
403404
* @param string $type

0 commit comments

Comments
 (0)