Skip to content

Commit 054427c

Browse files
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into develop
2 parents 6fa5f7d + 503245f commit 054427c

File tree

776 files changed

+25734
-5858
lines changed

Some content is hidden

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

776 files changed

+25734
-5858
lines changed

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/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
}

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
99
<acl>
1010
<resources>
11-
<resource id="Magento_Backend::all" title="Allow everything" sortOrder="10" />
12-
<resource id="Magento_Backend::admin" title="Magento Admin" sortOrder="20">
13-
<resource id="Magento_Backend::dashboard" title="Dashboard" sortOrder="0" />
14-
<resource id="Magento_Backend::global_search" title="Global Search" sortOrder="100" />
15-
<resource id="Magento_Backend::myaccount" title="My Account" sortOrder="50" />
16-
<resource id="Magento_Backend::marketing" title="Marketing" sortOrder="50">
17-
<resource id="Magento_Backend::marketing_seo" title="SEO &amp; Search" sortOrder="40" />
18-
<resource id="Magento_Backend::marketing_user_content" title="User Content" sortOrder="50" />
11+
<resource id="Magento_Backend::all" title="Allow everything" translate="title" sortOrder="10" />
12+
<resource id="Magento_Backend::admin" title="Magento Admin" translate="title" sortOrder="20">
13+
<resource id="Magento_Backend::dashboard" title="Dashboard" translate="title" sortOrder="0" />
14+
<resource id="Magento_Backend::global_search" title="Global Search" translate="title" sortOrder="100" />
15+
<resource id="Magento_Backend::myaccount" title="My Account" translate="title" sortOrder="50" />
16+
<resource id="Magento_Backend::marketing" title="Marketing" translate="title" sortOrder="50">
17+
<resource id="Magento_Backend::marketing_seo" title="SEO &amp; Search" translate="title" sortOrder="40" />
18+
<resource id="Magento_Backend::marketing_user_content" title="User Content" translate="title" sortOrder="50" />
1919
</resource>
20-
<resource id="Magento_Backend::content" title="Content" sortOrder="60">
21-
<resource id="Magento_Backend::content_elements" title="Elements" sortOrder="10" />
22-
<resource id="Magento_Backend::design" title="Design" sortOrder="20">
23-
<resource id="Magento_Backend::schedule" title="Schedule" sortOrder="30" />
20+
<resource id="Magento_Backend::content" title="Content" translate="title" sortOrder="60">
21+
<resource id="Magento_Backend::content_elements" title="Elements" translate="title" sortOrder="10" />
22+
<resource id="Magento_Backend::design" title="Design" translate="title" sortOrder="20">
23+
<resource id="Magento_Backend::schedule" title="Schedule" translate="title" sortOrder="30" />
2424
</resource>
2525
</resource>
26-
<resource id="Magento_Backend::stores" title="Stores" sortOrder="80">
27-
<resource id="Magento_Backend::stores_settings" title="Settings" sortOrder="10">
28-
<resource id="Magento_Backend::store" title="All Stores" sortOrder="10"/>
26+
<resource id="Magento_Backend::stores" title="Stores" translate="title" sortOrder="80">
27+
<resource id="Magento_Backend::stores_settings" title="Settings" translate="title" sortOrder="10">
28+
<resource id="Magento_Backend::store" title="All Stores" translate="title" sortOrder="10"/>
2929
</resource>
30-
<resource id="Magento_Backend::stores_attributes" title="Attributes" sortOrder="40" />
31-
<resource id="Magento_Backend::stores_other_settings" title="Other Settings" sortOrder="50" />
30+
<resource id="Magento_Backend::stores_attributes" title="Attributes" translate="title" sortOrder="40" />
31+
<resource id="Magento_Backend::stores_other_settings" title="Other Settings" translate="title" sortOrder="50" />
3232
</resource>
33-
<resource id="Magento_Backend::system" title="System" sortOrder="90">
34-
<resource id="Magento_Backend::convert" title="Data Transfer" sortOrder="10" />
35-
<resource id="Magento_Backend::extensions" title="Magento Connect" sortOrder="20">
36-
<resource id="Magento_Backend::local" title="Connect Manager" sortOrder="10" />
37-
<resource id="Magento_Backend::custom" title="Package Extensions" sortOrder="20" />
33+
<resource id="Magento_Backend::system" title="System" translate="title" sortOrder="90">
34+
<resource id="Magento_Backend::convert" title="Data Transfer" translate="title" sortOrder="10" />
35+
<resource id="Magento_Backend::extensions" title="Magento Connect" translate="title" sortOrder="20">
36+
<resource id="Magento_Backend::local" title="Connect Manager" translate="title" sortOrder="10" />
37+
<resource id="Magento_Backend::custom" title="Package Extensions" translate="title" sortOrder="20" />
3838
</resource>
39-
<resource id="Magento_Backend::tools" title="Tools" sortOrder="50">
40-
<resource id="Magento_Backend::cache" title="Cache Management" sortOrder="10" />
41-
<resource id="Magento_Backend::setup_wizard" title="Web Setup Wizard" sortOrder="20" />
39+
<resource id="Magento_Backend::tools" title="Tools" translate="title" sortOrder="50">
40+
<resource id="Magento_Backend::cache" title="Cache Management" translate="title" sortOrder="10" />
41+
<resource id="Magento_Backend::setup_wizard" title="Web Setup Wizard" translate="title" sortOrder="20" />
4242
</resource>
43-
<resource id="Magento_Backend::system_other_settings" title="Other Settings" sortOrder="80" />
43+
<resource id="Magento_Backend::system_other_settings" title="Other Settings" translate="title" sortOrder="80" />
4444
</resource>
4545
</resource>
4646
</resources>

0 commit comments

Comments
 (0)