Skip to content

Commit a3ee58a

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feature/short-echo-tags
2 parents 48bd391 + 04b3b52 commit a3ee58a

File tree

88 files changed

+1640
-303
lines changed

Some content is hidden

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

88 files changed

+1640
-303
lines changed

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
name="login[password]"
4343
data-validate="{required:true}"
4444
value=""
45-
placeholder="<?= /* @escapeNotVerified */ __('password') ?>"
46-
autocomplete="off"
45+
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
46+
autocomplete="new-password"
4747
/>
4848
</div>
4949
</div>

app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<form action="" method="post" id="rollback-form" class="form-inline">
7373
<fieldset class="admin__fieldset password-box-container">
7474
<div class="admin__field field _required">
75-
<label for="password" class="admin__field-label"><span><?= /* @escapeNotVerified */ __('User Password') ?></span></label>
76-
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="off"></div>
75+
<label for="password" class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('User Password')?></span></label>
76+
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="new-password"></div>
7777
</div>
7878

7979
<div class="admin__field field maintenance-checkbox-container">
@@ -119,7 +119,7 @@
119119
<span><?= /* @escapeNotVerified */ __('FTP Password') ?></span>
120120
</label>
121121
<div class="admin__field-control">
122-
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="off">
122+
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="new-password">
123123
</div>
124124
</div>
125125
<div class="admin__field field">

app/code/Magento/Braintree/Block/Paypal/Button.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*/
66
namespace Magento\Braintree\Block\Paypal;
77

8-
use Magento\Checkout\Model\Session;
8+
use Magento\Braintree\Gateway\Config\PayPal\Config;
9+
use Magento\Braintree\Model\Ui\ConfigProvider;
910
use Magento\Catalog\Block\ShortcutInterface;
10-
use Magento\Framework\View\Element\Template;
11+
use Magento\Checkout\Model\Session;
1112
use Magento\Framework\Locale\ResolverInterface;
12-
use Magento\Braintree\Model\Ui\ConfigProvider;
13+
use Magento\Framework\View\Element\Template;
1314
use Magento\Framework\View\Element\Template\Context;
14-
use Magento\Braintree\Gateway\Config\PayPal\Config;
1515
use Magento\Payment\Model\MethodInterface;
1616

1717
/**
@@ -110,7 +110,7 @@ public function getContainerId()
110110
*/
111111
public function getLocale()
112112
{
113-
return strtolower($this->localeResolver->getLocale());
113+
return $this->localeResolver->getLocale();
114114
}
115115

116116
/**
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Braintree\Model;
7+
8+
use Magento\Framework\Locale\ResolverInterface;
9+
use Magento\Braintree\Gateway\Config\PayPal\Config;
10+
11+
class LocaleResolver implements ResolverInterface
12+
{
13+
/**
14+
* @var ResolverInterface
15+
*/
16+
private $resolver;
17+
18+
/**
19+
* @var Config
20+
*/
21+
private $config;
22+
23+
/**
24+
* @param ResolverInterface $resolver
25+
* @param Config $config
26+
*/
27+
public function __construct(ResolverInterface $resolver, Config $config)
28+
{
29+
$this->resolver = $resolver;
30+
$this->config = $config;
31+
}
32+
33+
/**
34+
* @inheritdoc
35+
*/
36+
public function getDefaultLocalePath()
37+
{
38+
return $this->resolver->getDefaultLocalePath();
39+
}
40+
41+
/**
42+
* @inheritdoc
43+
*/
44+
public function setDefaultLocale($locale)
45+
{
46+
return $this->resolver->setDefaultLocale($locale);
47+
}
48+
49+
/**
50+
* @inheritdoc
51+
*/
52+
public function getDefaultLocale()
53+
{
54+
return $this->resolver->getDefaultLocale();
55+
}
56+
57+
/**
58+
* @inheritdoc
59+
*/
60+
public function setLocale($locale = null)
61+
{
62+
return $this->resolver->setLocale($locale);
63+
}
64+
65+
/**
66+
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal.
67+
*
68+
* @return string
69+
*/
70+
public function getLocale()
71+
{
72+
$locale = $this->resolver->getLocale();
73+
$allowedLocales = $this->config->getValue('supported_locales');
74+
75+
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';
76+
}
77+
78+
/**
79+
* @inheritdoc
80+
*/
81+
public function emulate($scopeId)
82+
{
83+
return $this->resolver->emulate($scopeId);
84+
}
85+
86+
/**
87+
* @inheritdoc
88+
*/
89+
public function revert()
90+
{
91+
return $this->resolver->revert();
92+
}
93+
}

app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getConfig()
5454
'title' => $this->config->getTitle(),
5555
'isAllowShippingAddressOverride' => $this->config->isAllowToEditShippingAddress(),
5656
'merchantName' => $this->config->getMerchantName(),
57-
'locale' => strtolower($this->resolver->getLocale()),
57+
'locale' => $this->resolver->getLocale(),
5858
'paymentAcceptanceMarkSrc' =>
5959
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
6060
'vaultCode' => self::PAYPAL_VAULT_CODE,

app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,35 @@ protected function setUp()
4949
/**
5050
* Run test getConfig method
5151
*
52-
* @param array $config
52+
* @param array $expected
5353
* @dataProvider getConfigDataProvider
5454
*/
5555
public function testGetConfig($expected)
5656
{
57-
$this->config->expects(static::once())
58-
->method('isActive')
57+
$this->config->method('isActive')
5958
->willReturn(true);
6059

61-
$this->config->expects(static::once())
62-
->method('isAllowToEditShippingAddress')
60+
$this->config->method('isAllowToEditShippingAddress')
6361
->willReturn(true);
6462

65-
$this->config->expects(static::once())
66-
->method('getMerchantName')
63+
$this->config->method('getMerchantName')
6764
->willReturn('Test');
6865

69-
$this->config->expects(static::once())
70-
->method('getTitle')
66+
$this->config->method('getTitle')
7167
->willReturn('Payment Title');
7268

73-
$this->localeResolver->expects(static::once())
74-
->method('getLocale')
69+
$this->localeResolver->method('getLocale')
7570
->willReturn('en_US');
7671

77-
$this->config->expects(static::once())
78-
->method('isSkipOrderReview')
72+
$this->config->method('isSkipOrderReview')
7973
->willReturn(false);
8074

81-
$this->config->expects(static::once())
82-
->method('getPayPalIcon')
75+
$this->config->method('getPayPalIcon')
8376
->willReturn([
8477
'width' => 30, 'height' => 26, 'url' => 'https://icon.test.url'
8578
]);
8679

87-
static::assertEquals($expected, $this->configProvider->getConfig());
80+
self::assertEquals($expected, $this->configProvider->getConfig());
8881
}
8982

9083
/**
@@ -101,7 +94,7 @@ public function getConfigDataProvider()
10194
'title' => 'Payment Title',
10295
'isAllowShippingAddressOverride' => true,
10396
'merchantName' => 'Test',
104-
'locale' => 'en_us',
97+
'locale' => 'en_US',
10598
'paymentAcceptanceMarkSrc' =>
10699
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
107100
'vaultCode' => ConfigProvider::PAYPAL_VAULT_CODE,

app/code/Magento/Braintree/etc/config.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<order_status>processing</order_status>
3535
<environment>sandbox</environment>
3636
<allowspecific>0</allowspecific>
37-
<sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.25.0.min.js]]></sdk_url>
37+
<sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.32.0.min.js]]></sdk_url>
3838
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
3939
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
4040
<masked_fields>cvv,number</masked_fields>
@@ -66,6 +66,7 @@
6666
<can_capture_vault>1</can_capture_vault>
6767
<privateInfoKeys>processorResponseCode,processorResponseText,paymentId</privateInfoKeys>
6868
<paymentInfoKeys>processorResponseCode,processorResponseText,paymentId,payerEmail</paymentInfoKeys>
69+
<supported_locales>en_US,en_GB,en_AU,da_DK,fr_FR,fr_CA,de_DE,zh_HK,it_IT,nl_NL,no_NO,pl_PL,es_ES,sv_SE,tr_TR,pt_BR,ja_JP,id_ID,ko_KR,pt_PT,ru_RU,th_TH,zh_CN,zh_TW</supported_locales>
6970
</braintree_paypal>
7071
<braintree_cc_vault>
7172
<model>BraintreeCreditCardVaultFacade</model>

app/code/Magento/Braintree/etc/frontend/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
<type name="Magento\Braintree\Block\Paypal\Button">
4848
<arguments>
49+
<argument name="localeResolver" xsi:type="object">Magento\Braintree\Model\LocaleResolver</argument>
4950
<argument name="data" xsi:type="array">
5051
<item name="template" xsi:type="string">Magento_Braintree::paypal/button.phtml</item>
5152
<item name="alias" xsi:type="string">braintree.paypal.mini-cart</item>
@@ -54,4 +55,10 @@
5455
<argument name="payment" xsi:type="object">BraintreePayPalFacade</argument>
5556
</arguments>
5657
</type>
58+
59+
<type name="Magento\Braintree\Model\Ui\PayPal\ConfigProvider">
60+
<arguments>
61+
<argument name="resolver" xsi:type="object">Magento\Braintree\Model\LocaleResolver</argument>
62+
</arguments>
63+
</type>
5764
</config>

app/code/Magento/Braintree/view/frontend/requirejs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var config = {
77
map: {
88
'*': {
9-
braintree: 'https://js.braintreegateway.com/js/braintree-2.25.0.min.js'
9+
braintree: 'https://js.braintreegateway.com/js/braintree-2.32.0.min.js'
1010
}
1111
}
1212
};

app/code/Magento/Braintree/view/frontend/web/js/paypal/button.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ define(
105105
event.preventDefault();
106106

107107
registry.get(self.integrationName, function (integration) {
108-
integration.paypal.initAuthFlow();
108+
try {
109+
integration.paypal.initAuthFlow();
110+
} catch (e) {
111+
$this.attr('disabled', 'disabled');
112+
}
109113
});
110114
});
111115
}.bind(this);

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define([
1313
'Magento_Checkout/js/model/full-screen-loader',
1414
'Magento_Checkout/js/model/payment/additional-validators',
1515
'Magento_Vault/js/view/payment/vault-enabler',
16-
'Magento_Checkout/js/action/create-billing-address'
16+
'Magento_Checkout/js/action/create-billing-address',
17+
'mage/translate'
1718
], function (
1819
$,
1920
_,
@@ -23,7 +24,8 @@ define([
2324
fullScreenLoader,
2425
additionalValidators,
2526
VaultEnabler,
26-
createBillingAddress
27+
createBillingAddress,
28+
$t
2729
) {
2830
'use strict';
2931

@@ -403,7 +405,13 @@ define([
403405
*/
404406
payWithPayPal: function () {
405407
if (additionalValidators.validate()) {
406-
Braintree.checkout.paypal.initAuthFlow();
408+
try {
409+
Braintree.checkout.paypal.initAuthFlow();
410+
} catch (e) {
411+
this.messageContainer.addErrorMessage({
412+
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
413+
});
414+
}
407415
}
408416
},
409417

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ protected function setUp()
5656
$this->productMock = $this->getMockBuilder(ProductInterface::class)
5757
->setMethods([
5858
'getId',
59+
'getTypeId',
5960
'getStoreId',
6061
'getResource',
6162
'getData',

app/code/Magento/Catalog/etc/mview.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<table name="catalog_product_entity_decimal" entity_column="entity_id" />
3737
<table name="catalog_product_entity_gallery" entity_column="entity_id" />
3838
<table name="catalog_product_entity_int" entity_column="entity_id" />
39-
<table name="catalog_product_entity_media_gallery" entity_column="value_id" />
4039
<table name="catalog_product_entity_media_gallery_value" entity_column="entity_id" />
4140
<table name="catalog_product_entity_text" entity_column="entity_id" />
4241
<table name="catalog_product_entity_tier_price" entity_column="entity_id" />

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<formElements>
2828
<fileUploader>
2929
<settings>
30-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
30+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
3131
<maxFileSize>2097152</maxFileSize>
3232
<uploaderConfig>
3333
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
@@ -87,7 +87,7 @@
8787
<formElements>
8888
<fileUploader>
8989
<settings>
90-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
90+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
9191
<maxFileSize>2097152</maxFileSize>
9292
<uploaderConfig>
9393
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
@@ -147,7 +147,7 @@
147147
<formElements>
148148
<fileUploader>
149149
<settings>
150-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
150+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
151151
<maxFileSize>2097152</maxFileSize>
152152
<uploaderConfig>
153153
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,15 +1228,15 @@ protected function _saveLinks()
12281228
'linked_product_id' => $linkedId,
12291229
'link_type_id' => $linkId,
12301230
];
1231-
if (!empty($linkPositions[$linkedKey])) {
1232-
$positionRows[] = [
1233-
'link_id' => $productLinkKeys[$linkKey],
1234-
'product_link_attribute_id' => $positionAttrId[$linkId],
1235-
'value' => $linkPositions[$linkedKey],
1236-
];
1237-
}
1238-
$nextLinkId++;
12391231
}
1232+
if (!empty($linkPositions[$linkedKey])) {
1233+
$positionRows[] = [
1234+
'link_id' => $productLinkKeys[$linkKey],
1235+
'product_link_attribute_id' => $positionAttrId[$linkId],
1236+
'value' => $linkPositions[$linkedKey],
1237+
];
1238+
}
1239+
$nextLinkId++;
12401240
}
12411241
}
12421242
}

app/code/Magento/CatalogInventory/Model/Stock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Stock extends AbstractExtensibleModel implements StockInterface
3232
*
3333
* @var string
3434
*/
35-
protected $eventObject = 'stock';
35+
protected $_eventObject = 'stock';
3636

3737
const BACKORDERS_NO = 0;
3838

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Item extends AbstractExtensibleModel implements StockItemInterface
4343
*
4444
* @var string
4545
*/
46-
protected $eventObject = 'item';
46+
protected $_eventObject = 'item';
4747

4848
/**
4949
* Store model manager

0 commit comments

Comments
 (0)