Skip to content

Commit 89dccd3

Browse files
committed
MAGETWO-70056: Get sitemap product images from image cache, if available #9082
- Merge Pull Request #9082 from sambolek/magento2:issue-7504 - Merged commits: 1. 3f671db 2. 9c44917 3. 5bdf783 4. 51c6862 5. 7e8ec05 6. 7a293c8 7. 27d1ef2 8. b33820a 9. baab9a6 10. e85e717 11. ae9010b 12. da4de8b 13. c127b4c 14. 6b96f4c 15. f3f94e0 16. 285bcd4 17. 029f3d6 18. a709114 19. 1a7fb83
2 parents d844e31 + 1a7fb83 commit 89dccd3

File tree

124 files changed

+2186
-495
lines changed

Some content is hidden

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

124 files changed

+2186
-495
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
46-
autocomplete="off"
46+
autocomplete="new-password"
4747
/>
4848
</div>
4949
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<fieldset class="admin__fieldset password-box-container">
7474
<div class="admin__field field _required">
7575
<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="off"></div>
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><?php /* @escapeNotVerified */ echo __('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);

0 commit comments

Comments
 (0)