Skip to content

Commit eb495a1

Browse files
Merge branch 'develop' into patch-3
2 parents ca46d9b + 503245f commit eb495a1

File tree

1,370 files changed

+44336
-14810
lines changed

Some content is hidden

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

1,370 files changed

+44336
-14810
lines changed

.htaccess

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,3 @@
285285
## http://developer.yahoo.com/performance/rules.html#etags
286286

287287
#FileETag none
288-
289-
############################################
290-
## Add custom headers
291-
<IfModule mod_headers.c>
292-
Header set X-Content-Type-Options "nosniff"
293-
Header set X-XSS-Protection "1; mode=block"
294-
</IfModule>

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,7 @@ Tests:
28682868
* Fixed a 404 error after saving mass update product attributes form
28692869
* Fixed an issue when it was impossible to perform search by all tax classes on the Advanced Search page
28702870
* Fixed an issue when attribute order for configurable product was not preserved after saving product
2871-
* Fixed an issue with no results for the Product Best Sellers report
2871+
* Fixed an issue with no results for the Product Bestsellers report
28722872
* Fixed a fatal error when opening tax configuration page in the backend
28732873
* Fixed an error occurring when opening the Tax Zones and Rates page in the backend
28742874
* Fixed a 404 error occurring while searching products on the New Review page

app/code/Magento/AdminNotification/etc/acl.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<resource id="Magento_Backend::admin">
1212
<resource id="Magento_Backend::system">
1313
<resource id="Magento_Backend::system_other_settings">
14-
<resource id="Magento_AdminNotification::adminnotification" title="Notifications" sortOrder="10">
15-
<resource id="Magento_AdminNotification::show_toolbar" title="Show Toolbar" sortOrder="10" />
16-
<resource id="Magento_AdminNotification::show_list" title="Show List" sortOrder="20" />
17-
<resource id="Magento_AdminNotification::mark_as_read" title="Mark as Read" sortOrder="30" />
18-
<resource id="Magento_AdminNotification::adminnotification_remove" title="Remove" sortOrder="40" />
14+
<resource id="Magento_AdminNotification::adminnotification" title="Notifications" translate="title" sortOrder="10">
15+
<resource id="Magento_AdminNotification::show_toolbar" title="Show Toolbar" translate="title" sortOrder="10" />
16+
<resource id="Magento_AdminNotification::show_list" title="Show List" translate="title" sortOrder="20" />
17+
<resource id="Magento_AdminNotification::mark_as_read" title="Mark as Read" translate="title" sortOrder="30" />
18+
<resource id="Magento_AdminNotification::adminnotification_remove" title="Remove" translate="title" sortOrder="40" />
1919
</resource>
2020
</resource>
2121
</resource>

app/code/Magento/AdminNotification/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
99
<menu>
10-
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
10+
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" translate="title" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
1111
</menu>
1212
</config>

app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function testCheckResponseCodeFailure($responseCode)
331331
$this->dataHelperMock->expects($this->any())
332332
->method('wrapGatewayError')
333333
->with($reasonText)
334-
->willReturn(__('Gateway error: ' . $reasonText));
334+
->willReturn(__('Gateway error: %1', $reasonText));
335335

336336
$this->directpost->checkResponseCode();
337337
}

app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,59 @@
55
define(
66
[
77
'jquery',
8-
'Magento_Payment/js/view/payment/iframe',
9-
'Magento_Checkout/js/action/set-payment-information',
10-
'Magento_Checkout/js/model/payment/additional-validators',
11-
'Magento_Checkout/js/model/full-screen-loader'
8+
'Magento_Payment/js/view/payment/iframe'
129
],
13-
function ($, Component, setPaymentInformationAction, additionalValidators, fullScreenLoader) {
10+
function ($, Component) {
1411
'use strict';
1512

1613
return Component.extend({
1714
defaults: {
18-
template: 'Magento_Authorizenet/payment/authorizenet-directpost'
15+
template: 'Magento_Authorizenet/payment/authorizenet-directpost',
16+
timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'
1917
},
2018
placeOrderHandler: null,
2119
validateHandler: null,
2220

23-
setPlaceOrderHandler: function(handler) {
21+
/**
22+
* @param {Object} handler
23+
*/
24+
setPlaceOrderHandler: function (handler) {
2425
this.placeOrderHandler = handler;
2526
},
2627

27-
setValidateHandler: function(handler) {
28+
/**
29+
* @param {Object} handler
30+
*/
31+
setValidateHandler: function (handler) {
2832
this.validateHandler = handler;
2933
},
3034

31-
context: function() {
35+
/**
36+
* @returns {Object}
37+
*/
38+
context: function () {
3239
return this;
3340
},
3441

35-
isShowLegend: function() {
42+
/**
43+
* @returns {Boolean}
44+
*/
45+
isShowLegend: function () {
3646
return true;
3747
},
3848

39-
getCode: function() {
49+
/**
50+
* @returns {String}
51+
*/
52+
getCode: function () {
4053
return 'authorizenet_directpost';
4154
},
4255

43-
isActive: function() {
44-
return true;
45-
},
46-
4756
/**
48-
* @override
57+
* @returns {Boolean}
4958
*/
50-
placeOrder: function () {
51-
var self = this;
52-
53-
if (this.validateHandler() && additionalValidators.validate()) {
54-
fullScreenLoader.startLoader();
55-
this.isPlaceOrderActionAllowed(false);
56-
$.when(setPaymentInformationAction(this.messageContainer, {
57-
'method': self.getCode()
58-
})).done(function () {
59-
self.placeOrderHandler().fail(function () {
60-
fullScreenLoader.stopLoader();
61-
});
62-
}).fail(function () {
63-
fullScreenLoader.stopLoader();
64-
self.isPlaceOrderActionAllowed(true);
65-
});
66-
}
59+
isActive: function () {
60+
return true;
6761
}
6862
});
6963
}

app/code/Magento/Backend/Block/System/Account/Edit/Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function _prepareForm()
100100
'name' => 'password',
101101
'label' => __('New Password'),
102102
'title' => __('New Password'),
103-
'class' => 'input-text validate-admin-password'
103+
'class' => 'validate-admin-password admin__control-text'
104104
]
105105
);
106106

@@ -110,7 +110,7 @@ protected function _prepareForm()
110110
[
111111
'name' => 'password_confirmation',
112112
'label' => __('Password Confirmation'),
113-
'class' => 'input-text validate-cpassword'
113+
'class' => 'validate-cpassword admin__control-text'
114114
]
115115
);
116116

@@ -138,7 +138,7 @@ protected function _prepareForm()
138138
'label' => __('Your Password'),
139139
'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD,
140140
'title' => __('Your Password'),
141-
'class' => 'input-text validate-current-password required-entry',
141+
'class' => 'validate-current-password required-entry admin__control-text',
142142
'required' => true
143143
]
144144
);

app/code/Magento/Backend/Block/Widget/Tabs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function addTabAfter($tabId, $tab, $afterTabId)
112112
public function addTab($tabId, $tab)
113113
{
114114
if (empty($tabId)) {
115-
throw new \Exception(__('Please correct the tab configuration and try again. Tab Id should be not empry'));
115+
throw new \Exception(__('Please correct the tab configuration and try again. Tab Id should be not empty'));
116116
}
117117
if (is_array($tab)) {
118118
$this->_tabs[$tabId] = new \Magento\Framework\DataObject($tab);

app/code/Magento/Backend/Model/Locale/Manager.php

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,30 @@ class Manager
2626
* @var \Magento\Framework\TranslateInterface
2727
*/
2828
protected $_translator;
29+
30+
/**
31+
* @var \Magento\Backend\App\ConfigInterface
32+
*/
33+
protected $_backendConfig;
2934

3035
/**
3136
* Constructor
3237
*
3338
* @param \Magento\Backend\Model\Session $session
3439
* @param \Magento\Backend\Model\Auth\Session $authSession
3540
* @param \Magento\Framework\TranslateInterface $translator
41+
* @param \Magento\Backend\App\ConfigInterface $backendConfig
3642
*/
3743
public function __construct(
3844
\Magento\Backend\Model\Session $session,
3945
\Magento\Backend\Model\Auth\Session $authSession,
40-
\Magento\Framework\TranslateInterface $translator
46+
\Magento\Framework\TranslateInterface $translator,
47+
\Magento\Backend\App\ConfigInterface $backendConfig
4148
) {
4249
$this->_session = $session;
4350
$this->_authSession = $authSession;
4451
$this->_translator = $translator;
52+
$this->_backendConfig = $backendConfig;
4553
}
4654

4755
/**
@@ -53,28 +61,40 @@ public function __construct(
5361
public function switchBackendInterfaceLocale($localeCode)
5462
{
5563
$this->_session->setSessionLocale(null);
56-
64+
5765
$this->_authSession->getUser()->setInterfaceLocale($localeCode);
58-
66+
5967
$this->_translator->setLocale($localeCode)->loadData(null, true);
60-
68+
6169
return $this;
6270
}
6371

72+
/**
73+
* Get general interface locale
74+
*
75+
* @return string
76+
*/
77+
public function getGeneralLocale()
78+
{
79+
return $this->_backendConfig->getValue('general/locale/code');
80+
}
81+
6482
/**
6583
* Get user interface locale stored in session data
6684
*
6785
* @return string
6886
*/
6987
public function getUserInterfaceLocale()
7088
{
71-
$interfaceLocale = \Magento\Framework\Locale\Resolver::DEFAULT_LOCALE;
72-
7389
$userData = $this->_authSession->getUser();
90+
$interfaceLocale = \Magento\Framework\Locale\Resolver::DEFAULT_LOCALE;
91+
7492
if ($userData && $userData->getInterfaceLocale()) {
7593
$interfaceLocale = $userData->getInterfaceLocale();
94+
} elseif ($this->getGeneralLocale()) {
95+
$interfaceLocale = $this->getGeneralLocale();
7696
}
77-
97+
7898
return $interfaceLocale;
7999
}
80100
}

app/code/Magento/Backend/Test/Unit/Model/Locale/ManagerTest.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
1515
protected $_model;
1616

1717
/**
18-
* @var \Magento\Framework\TranslateInterface
18+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\TranslateInterface
1919
*/
2020
protected $_translator;
2121

@@ -25,9 +25,14 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
2525
protected $_session;
2626

2727
/**
28-
* @var \Magento\Backend\Model\Auth\Session
28+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Backend\Model\Auth\Session
2929
*/
3030
protected $_authSession;
31+
32+
/**
33+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Backend\App\ConfigInterface
34+
*/
35+
protected $_backendConfig;
3136

3237
protected function setUp()
3338
{
@@ -40,7 +45,9 @@ protected function setUp()
4045
'',
4146
false
4247
);
43-
48+
49+
$this->_backendConfig = $this->getMockForAbstractClass('Magento\Backend\App\ConfigInterface', [], '', false);
50+
4451
$userMock = new \Magento\Framework\DataObject();
4552

4653
$this->_authSession->expects($this->any())->method('getUser')->will($this->returnValue($userMock));
@@ -54,7 +61,8 @@ protected function setUp()
5461
$this->_model = new \Magento\Backend\Model\Locale\Manager(
5562
$this->_session,
5663
$this->_authSession,
57-
$this->_translator
64+
$this->_translator,
65+
$this->_backendConfig
5866
);
5967
}
6068

@@ -102,4 +110,17 @@ public function testGetUserInterfaceLocale()
102110

103111
$this->assertEquals($locale, 'de_DE');
104112
}
113+
114+
/**
115+
* @covers \Magento\Backend\Model\Locale\Manager::getUserInterfaceLocale
116+
*/
117+
public function testGetUserInterfaceGeneralLocale()
118+
{
119+
$this->_backendConfig->expects($this->any())
120+
->method('getValue')
121+
->with('general/locale/code')
122+
->willReturn('test_locale');
123+
$locale = $this->_model->getUserInterfaceLocale();
124+
$this->assertEquals($locale, 'test_locale');
125+
}
105126
}

0 commit comments

Comments
 (0)