Skip to content

Commit a7cb0c2

Browse files
author
Tang, Yu(ytang1)
committed
Merge pull request #278 from magento-extensibility/develop
[Extensibility] Bug fixes, public APIs, Sprint 50
2 parents 635ce44 + fa7c1fc commit a7cb0c2

File tree

150 files changed

+2704
-1084
lines changed

Some content is hidden

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

150 files changed

+2704
-1084
lines changed

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

+5-3
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/Page/System/Config/Robots/Reset.php

+3-1
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

+5-2
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

+1-1
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

-33
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

+5-2
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
}

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

+3-3
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

+3-1
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
/**

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ protected function setUp()
182182
'',
183183
false
184184
);
185+
$appStateMock = $this->getMock(
186+
'Magento\Framework\App\State',
187+
[],
188+
[],
189+
'',
190+
false
191+
);
185192
$this->storeManagerMock = $this->getMockForAbstractClass(
186193
'Magento\Store\Model\StoreManagerInterface',
187194
[],
@@ -201,11 +208,12 @@ protected function setUp()
201208
'storage' => $this->storageMock,
202209
'cookieManager' => $this->cookieManagerMock,
203210
'cookieMetadataFactory' => $this->cookieMetadataFactoryMock,
211+
'appState' => $appStateMock,
204212
'customerRepository' => $this->customerRepositoryMock,
205213
'quoteRepository' => $this->quoteRepositoryMock,
206214
'orderFactory' => $this->orderFactoryMock,
207215
'storeManager' => $this->storeManagerMock,
208-
'groupManagement' => $this->groupManagementMock
216+
'groupManagement' => $this->groupManagementMock,
209217
],
210218
'',
211219
true

app/code/Magento/Backend/Test/Unit/Model/UrlTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function setUp()
165165
'menuConfig' => $this->_menuConfigMock,
166166
'authSession' => $this->_authSessionMock,
167167
'encryptor' => $this->_encryptor,
168-
'routeParamsResolver' => $this->_paramsResolverMock
168+
'routeParamsResolverFactory' => $this->_paramsResolverMock
169169
]
170170
);
171171
$this->_paramsResolverMock->expects(
@@ -186,7 +186,7 @@ protected function setUp()
186186
'menuConfig' => $this->_menuConfigMock,
187187
'authSession' => $this->_authSessionMock,
188188
'encryptor' => $this->_encryptor,
189-
'routeParamsResolver' => $this->_paramsResolverMock
189+
'routeParamsResolverFactory' => $this->_paramsResolverMock
190190
]
191191
);
192192

@@ -259,7 +259,7 @@ public function testGetAreaFrontName()
259259
[
260260
'backendHelper' => $helperMock,
261261
'authSession' => $this->_authSessionMock,
262-
'routeParamsResolver' => $this->_paramsResolverMock
262+
'routeParamsResolverFactory' => $this->_paramsResolverMock
263263
]
264264
);
265265
$urlModel->getAreaFrontName();

app/code/Magento/Backup/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.
22

3-
This module does not effect the storefront.
3+
This module does not affect the storefront.

app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<arguments>
4747
<argument name="header" xsi:type="string" translate="true">Name</argument>
4848
<argument name="index" xsi:type="string">display_name</argument>
49-
<argument name="filter" xsi:type="string">0</argument>
5049
<argument name="sortable" xsi:type="string">1</argument>
5150
<argument name="column_css_class" xsi:type="string">col-name</argument>
5251
<argument name="header_css_class" xsi:type="string">col-name</argument>

0 commit comments

Comments
 (0)