Skip to content

Commit 354b130

Browse files
author
Viktor Tymchynskyi
committed
Merge branch 'develop-mainline' into MAGETWO-34552-main
2 parents 4f29b1b + 4f25bdd commit 354b130

File tree

401 files changed

+12603
-4099
lines changed

Some content is hidden

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

401 files changed

+12603
-4099
lines changed

app/code/Magento/Backend/App/Config.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace Magento\Backend\App;
1212

13+
use Magento\Framework\App\Config\ScopeConfigInterface;
14+
1315
/**
1416
* Backend config accessor
1517
*/
@@ -36,7 +38,7 @@ public function __construct(\Magento\Framework\App\Config\ScopePool $scopePool)
3638
*/
3739
public function getValue($path)
3840
{
39-
return $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path);
41+
return $this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path);
4042
}
4143

4244
/**
@@ -48,7 +50,7 @@ public function getValue($path)
4850
*/
4951
public function setValue($path, $value)
5052
{
51-
$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->setValue($path, $value);
53+
$this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->setValue($path, $value);
5254
}
5355

5456
/**
@@ -59,6 +61,6 @@ public function setValue($path, $value)
5961
*/
6062
public function isSetFlag($path)
6163
{
62-
return !!$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path);
64+
return !!$this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path);
6365
}
6466
}

app/code/Magento/Backend/Block/Menu.php

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ protected function _addSubMenu($menuItem, $level, $limit, $id = null)
436436
* @param array $colBrakes
437437
* @return string HTML
438438
* @SuppressWarnings(PHPMD.NPathComplexity)
439+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
439440
*/
440441
public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
441442
{
@@ -454,21 +455,30 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
454455
}
455456

456457
$id = $this->getJsId($menuItem->getId());
457-
$output .= '<li ' . $this->getUiId(
458-
$menuItem->getId()
459-
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
460-
$menuItem,
461-
$level
462-
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
463-
. '" role="menu-item">' . $this->_renderAnchor(
464-
$menuItem,
465-
$level
466-
) . $this->_addSubMenu(
467-
$menuItem,
468-
$level,
469-
$limit,
470-
$id
471-
) . '</li>';
458+
if (count($menu) > 1 || $level != 1) {
459+
$output .= '<li ' . $this->getUiId(
460+
$menuItem->getId()
461+
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
462+
$menuItem,
463+
$level
464+
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
465+
. '" role="menu-item">' . $this->_renderAnchor(
466+
$menuItem,
467+
$level
468+
) . $this->_addSubMenu(
469+
$menuItem,
470+
$level,
471+
$limit,
472+
$id
473+
) . '</li>';
474+
} else {
475+
$output .= $this->_addSubMenu(
476+
$menuItem,
477+
$level,
478+
$limit,
479+
$id);
480+
}
481+
472482
$itemPosition++;
473483
}
474484

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Magento\Backend\Block\Page\System\Config\Robots;
1010

11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
1113
/**
1214
* "Reset to Defaults" button renderer
1315
*
@@ -50,7 +52,7 @@ protected function _construct()
5052
public function getRobotsDefaultCustomInstructions()
5153
{
5254
return trim((string)$this->_scopeConfig->getValue(
53-
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT
55+
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
5456
));
5557
}
5658

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ class Session extends \Magento\Framework\Session\SessionManager implements \Mage
6161
* @param \Magento\Framework\Session\StorageInterface $storage
6262
* @param CookieManagerInterface $cookieManager
6363
* @param CookieMetadataFactory $cookieMetadataFactory
64+
* @param \Magento\Framework\App\State $appState
6465
* @param \Magento\Framework\Acl\Builder $aclBuilder
6566
* @param \Magento\Backend\Model\UrlInterface $backendUrl
6667
* @param \Magento\Backend\App\ConfigInterface $config
68+
* @throws \Magento\Framework\Exception\SessionException
6769
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6870
*/
6971
public function __construct(
@@ -75,6 +77,7 @@ public function __construct(
7577
\Magento\Framework\Session\StorageInterface $storage,
7678
CookieManagerInterface $cookieManager,
7779
CookieMetadataFactory $cookieMetadataFactory,
80+
\Magento\Framework\App\State $appState,
7881
\Magento\Framework\Acl\Builder $aclBuilder,
7982
\Magento\Backend\Model\UrlInterface $backendUrl,
8083
\Magento\Backend\App\ConfigInterface $config
@@ -90,9 +93,9 @@ public function __construct(
9093
$validator,
9194
$storage,
9295
$cookieManager,
93-
$cookieMetadataFactory
96+
$cookieMetadataFactory,
97+
$appState
9498
);
95-
$this->start();
9699
}
97100

98101
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function switchBackendInterfaceLocale($localeCode)
6868
*/
6969
public function getUserInterfaceLocale()
7070
{
71-
$interfaceLocale = \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE;
71+
$interfaceLocale = \Magento\Framework\Locale\Resolver::DEFAULT_LOCALE;
7272

7373
$userData = $this->_authSession->getUser();
7474
if ($userData && $userData->getInterfaceLocale()) {

app/code/Magento/Backend/Model/Session.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,6 @@
99

1010
class Session extends \Magento\Framework\Session\SessionManager
1111
{
12-
/**
13-
* @param \Magento\Framework\App\Request\Http $request
14-
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
15-
* @param \Magento\Framework\Session\Config\ConfigInterface $sessionConfig
16-
* @param \Magento\Framework\Session\SaveHandlerInterface $saveHandler
17-
* @param \Magento\Framework\Session\ValidatorInterface $validator
18-
* @param \Magento\Framework\Session\StorageInterface $storage
19-
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
20-
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
21-
*/
22-
public function __construct(
23-
\Magento\Framework\App\Request\Http $request,
24-
\Magento\Framework\Session\SidResolverInterface $sidResolver,
25-
\Magento\Framework\Session\Config\ConfigInterface $sessionConfig,
26-
\Magento\Framework\Session\SaveHandlerInterface $saveHandler,
27-
\Magento\Framework\Session\ValidatorInterface $validator,
28-
\Magento\Framework\Session\StorageInterface $storage,
29-
\Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
30-
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
31-
) {
32-
parent::__construct(
33-
$request,
34-
$sidResolver,
35-
$sessionConfig,
36-
$saveHandler,
37-
$validator,
38-
$storage,
39-
$cookieManager,
40-
$cookieMetadataFactory
41-
);
42-
$this->start();
43-
}
44-
4512
/**
4613
* Skip path validation in backend area
4714
*

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ class Quote extends \Magento\Framework\Session\SessionManager
8383
* @param \Magento\Framework\Session\StorageInterface $storage
8484
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
8585
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
86+
* @param \Magento\Framework\App\State $appState
8687
* @param CustomerRepositoryInterface $customerRepository
8788
* @param \Magento\Quote\Model\QuoteRepository $quoteRepository
8889
* @param \Magento\Sales\Model\OrderFactory $orderFactory
8990
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
9091
* @param GroupManagementInterface $groupManagement
92+
* @throws \Magento\Framework\Exception\SessionException
9193
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
9294
*/
9395
public function __construct(
@@ -99,6 +101,7 @@ public function __construct(
99101
\Magento\Framework\Session\StorageInterface $storage,
100102
\Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
101103
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory,
104+
\Magento\Framework\App\State $appState,
102105
CustomerRepositoryInterface $customerRepository,
103106
\Magento\Quote\Model\QuoteRepository $quoteRepository,
104107
\Magento\Sales\Model\OrderFactory $orderFactory,
@@ -118,9 +121,9 @@ public function __construct(
118121
$validator,
119122
$storage,
120123
$cookieManager,
121-
$cookieMetadataFactory
124+
$cookieMetadataFactory,
125+
$appState
122126
);
123-
$this->start();
124127
if ($this->_storeManager->hasSingleStore()) {
125128
$this->setStoreId($this->_storeManager->getStore(true)->getId());
126129
}
@@ -147,7 +150,7 @@ public function getQuote()
147150
$this->_quote->setStoreId($this->getStoreId());
148151
}
149152

150-
if ($this->getCustomerId()) {
153+
if ($this->getCustomerId() && $this->getCustomerId() != $this->_quote->getCustomerId()) {
151154
$customer = $this->customerRepository->getById($this->getCustomerId());
152155
$this->_quote->assignCustomer($customer);
153156
}

app/code/Magento/Backend/Model/Url.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Url extends \Magento\Framework\Url implements \Magento\Backend\Model\UrlIn
8383
* @param \Magento\Framework\Url\ScopeResolverInterface $scopeResolver
8484
* @param \Magento\Framework\Session\Generic $session
8585
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
86-
* @param \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolver
86+
* @param \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory
8787
* @param \Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver
8888
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
8989
* @param string $scopeType
@@ -105,7 +105,7 @@ public function __construct(
105105
\Magento\Framework\Url\ScopeResolverInterface $scopeResolver,
106106
\Magento\Framework\Session\Generic $session,
107107
\Magento\Framework\Session\SidResolverInterface $sidResolver,
108-
\Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolver,
108+
\Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory,
109109
\Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver,
110110
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
111111
$scopeType,
@@ -126,7 +126,7 @@ public function __construct(
126126
$scopeResolver,
127127
$session,
128128
$sidResolver,
129-
$routeParamsResolver,
129+
$routeParamsResolverFactory,
130130
$queryParamsResolver,
131131
$scopeConfig,
132132
$scopeType,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Test\Unit\Model\Locale;
77

8+
use Magento\Framework\Locale\Resolver;
9+
810
class ManagerTest extends \PHPUnit_Framework_TestCase
911
{
1012
/**
@@ -87,7 +89,7 @@ public function testGetUserInterfaceLocaleDefault()
8789
{
8890
$locale = $this->_model->getUserInterfaceLocale();
8991

90-
$this->assertEquals($locale, \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE);
92+
$this->assertEquals($locale, Resolver::DEFAULT_LOCALE);
9193
}
9294

9395
/**

0 commit comments

Comments
 (0)