Skip to content

Commit 0de3910

Browse files
author
Denys Rudchenko
committed
Merge branch 'develop' into nord_develop
2 parents 8ff2e8a + 463c715 commit 0de3910

File tree

684 files changed

+13355
-3989
lines changed

Some content is hidden

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

684 files changed

+13355
-3989
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
0.74.0-beta11
2+
=============
3+
* Framework improvements:
4+
* Improved component Bookmarks component in scope of Enhanced Data Grids on CMS
5+
* Improved component Advanced Filtering component in scope of Enhanced Data Grids on CMS
6+
* Fixed bugs:
7+
* Fixed an issue where incorrect keys in REST request body allowed the request to go through successfully
8+
* Fixed an issue where interceptors were Generated with Invalid __wakeup()
9+
* Fixed an issue where redirect on the current page was not working in certain conditions
10+
* Fixed an issue where first store could not be selected on frontend
11+
* Fixed an issue with performance toolkit category creation
12+
* Fixed an issue when columns 'Interval', 'Price Rule' had incorrect values in Coupon Usage report
13+
* Fixed an issue where fatal error occured on Abandoned Carts report grid
14+
* Fixed an issue where it was not possible to add product to shopping cart if Use Secure URLs in Frontend = Yes
15+
* Fixed an issue where email was not required during Guest Checkout
16+
* Fixed broken ability to skip reindex in `bin/magento setup:performance:generate-fixtures` command
17+
* Fixed an issue where `bin/magento indexer:reindex` command failed after `bin/magento setup:di:compile` was run
18+
* Fixed bug with broken JS i18n
19+
* Fixed an issue with wrong value at created_at updated_at fields after quote* save
20+
* Fixed an issue where customer could not be created in backend after adding Image type attribute
21+
* Fixed Sales InvoiceItem and Order data interfaces implementation
22+
* Fixed an issue with performance toolkit medium profile
23+
* Fixed an issue where Excel Formula Injection via CSV/XML export
24+
* Fixed an issue where it was not possible to open the Customers page in backend
25+
* Fixed an issue with internal server error after clicking Continue on Billing information
26+
* Fixed an issue where it was not possible to place order with Fedex shipping method
27+
* Various changes:
28+
* Magento Centinel Removal
29+
* Removed ability to have multi-statement queries
30+
* Test coverage:
31+
* Unit tests coverage
32+
* Covered php code by unit tests after new checkout implementation
33+
* Github issues:
34+
* [#424](https://github.com/magento/magento2/issues/424) -- Combine tier pricing messages into block sentences
35+
* [#1300](https://github.com/magento/magento2/issues/1300), [#1311](https://github.com/magento/magento2/issues/1311), [#1313](https://github.com/magento/magento2/issues/1313) -- Creating product error with startdate
36+
137
0.74.0-beta10
238
=============
339
* Framework improvements:

Gruntfile.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,17 @@ module.exports = function (grunt) {
6868
'less:luma',
6969
'less:backend'
7070
],
71+
7172
/**
7273
* Documentation
7374
*/
7475
documentation: [
76+
'replace:documentation',
7577
'less:documentation',
7678
'styledocco:documentation',
79+
'usebanner:documentationCss',
80+
'usebanner:documentationLess',
81+
'usebanner:documentationHtml',
7782
'clean:var',
7883
'clean:pub'
7984
],
@@ -82,12 +87,6 @@ module.exports = function (grunt) {
8287
'mage-minify:legacy'
8388
],
8489

85-
'documentation-banners': [
86-
'usebanner:documentationCss',
87-
'usebanner:documentationLess',
88-
'usebanner:documentationHtml'
89-
],
90-
9190
spec: function (theme) {
9291
var runner = require('./dev/tests/js/jasmine/spec_runner');
9392

app/code/Magento/AdminNotification/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-store": "0.74.0-beta10",
7-
"magento/module-backend": "0.74.0-beta10",
8-
"magento/module-media-storage": "0.74.0-beta10",
9-
"magento/framework": "0.74.0-beta10",
6+
"magento/module-store": "0.74.0-beta11",
7+
"magento/module-backend": "0.74.0-beta11",
8+
"magento/module-media-storage": "0.74.0-beta11",
9+
"magento/framework": "0.74.0-beta11",
1010
"lib-libxml": "*",
1111
"magento/magento-composer-installer": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "0.74.0-beta10",
14+
"version": "0.74.0-beta11",
1515
"license": [
1616
"OSL-3.0",
1717
"AFL-3.0"

app/code/Magento/Authorization/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-backend": "0.74.0-beta10",
7-
"magento/framework": "0.74.0-beta10",
6+
"magento/module-backend": "0.74.0-beta11",
7+
"magento/framework": "0.74.0-beta11",
88
"magento/magento-composer-installer": "*"
99
},
1010
"type": "magento2-module",
11-
"version": "0.74.0-beta10",
11+
"version": "0.74.0-beta11",
1212
"license": [
1313
"OSL-3.0",
1414
"AFL-3.0"

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ abstract class AbstractAction extends \Magento\Framework\App\Action\Action
2222
*/
2323
const SESSION_NAMESPACE = 'adminhtml';
2424

25+
/**
26+
* Authorization level of a basic admin session
27+
*/
28+
const ADMIN_RESOURCE = 'Magento_Backend::admin';
29+
2530
/**
2631
* Array of actions which can be processed without secret key validation
2732
*
@@ -97,7 +102,7 @@ public function __construct(Action\Context $context)
97102
*/
98103
protected function _isAllowed()
99104
{
100-
return true;
105+
return $this->_authorization->isAllowed(self::ADMIN_RESOURCE);
101106
}
102107

103108
/**
@@ -228,14 +233,10 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
228233
*/
229234
protected function _isUrlChecked()
230235
{
231-
return !$this->_actionFlag->get(
232-
'',
233-
self::FLAG_IS_URLS_CHECKED
234-
) && !$this->getRequest()->getParam(
235-
'forwarded'
236-
) && !$this->_getSession()->getIsUrlNotice(
237-
true
238-
) && !$this->_canUseBaseUrl;
236+
return !$this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED)
237+
&& !$this->getRequest()->isForwarded()
238+
&& !$this->_getSession()->getIsUrlNotice(true)
239+
&& !$this->_canUseBaseUrl;
239240
}
240241

241242
/**

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -147,46 +147,25 @@ protected function _processNotLoggedInUser(\Magento\Framework\App\RequestInterfa
147147
if ($request->getPost('login') && $this->_performLogin($request)) {
148148
$isRedirectNeeded = $this->_redirectIfNeededAfterLogin($request);
149149
}
150-
if (!$isRedirectNeeded && !$request->getParam('forwarded')) {
150+
if (!$isRedirectNeeded && !$request->isForwarded()) {
151151
if ($request->getParam('isIframe')) {
152-
$request->setParam(
153-
'forwarded',
154-
true
155-
)->setRouteName(
156-
'adminhtml'
157-
)->setControllerName(
158-
'auth'
159-
)->setActionName(
160-
'deniedIframe'
161-
)->setDispatched(
162-
false
163-
);
152+
$request->setForwarded(true)
153+
->setRouteName('adminhtml')
154+
->setControllerName('auth')
155+
->setActionName('deniedIframe')
156+
->setDispatched(false);
164157
} elseif ($request->getParam('isAjax')) {
165-
$request->setParam(
166-
'forwarded',
167-
true
168-
)->setRouteName(
169-
'adminhtml'
170-
)->setControllerName(
171-
'auth'
172-
)->setActionName(
173-
'deniedJson'
174-
)->setDispatched(
175-
false
176-
);
158+
$request->setForwarded(true)
159+
->setRouteName('adminhtml')
160+
->setControllerName('auth')
161+
->setActionName('deniedJson')
162+
->setDispatched(false);
177163
} else {
178-
$request->setParam(
179-
'forwarded',
180-
true
181-
)->setRouteName(
182-
'adminhtml'
183-
)->setControllerName(
184-
'auth'
185-
)->setActionName(
186-
'login'
187-
)->setDispatched(
188-
false
189-
);
164+
$request->setForwarded(true)
165+
->setRouteName('adminhtml')
166+
->setControllerName('auth')
167+
->setActionName('login')
168+
->setDispatched(false);
190169
}
191170
}
192171
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ protected function _prepareLayout()
3131

3232
$this->addChild('sales', 'Magento\Backend\Block\Dashboard\Sales');
3333

34-
if ($this->_scopeConfig->getValue(self::XML_PATH_ENABLE_CHARTS, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
34+
$isChartEnabled = $this->_scopeConfig->getValue(
35+
self::XML_PATH_ENABLE_CHARTS,
36+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
37+
);
38+
if ($isChartEnabled) {
3539
$block = $this->getLayout()->createBlock('Magento\Backend\Block\Dashboard\Diagrams');
3640
} else {
3741
$block = $this->getLayout()->createBlock(
3842
'Magento\Backend\Block\Template'
3943
)->setTemplate(
4044
'dashboard/graph/disabled.phtml'
4145
)->setConfigUrl(
42-
$this->getUrl('adminhtml/system_config/edit', ['section' => 'admin'])
46+
$this->getUrl(
47+
'adminhtml/system_config/edit',
48+
['section' => 'admin', '_fragment' => 'admin_dashboard-link']
49+
)
4350
);
4451
}
4552
$this->setChild('diagrams', $block);

app/code/Magento/Backend/Controller/Adminhtml/Index/GlobalSearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function execute()
4848
$items[] = [
4949
'id' => 'error',
5050
'type' => __('Error'),
51-
'name' => __('Access Denied'),
51+
'name' => __('Access Denied.'),
5252
'description' => __('You need more permissions to do this.'),
5353
];
5454
} else {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getCredentialStorage()
145145
public function login($username, $password)
146146
{
147147
if (empty($username) || empty($password)) {
148-
self::throwException(__('Please correct the user name or password.'));
148+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
149149
}
150150

151151
try {
@@ -162,7 +162,7 @@ public function login($username, $password)
162162
}
163163

164164
if (!$this->getAuthStorage()->getUser()) {
165-
self::throwException(__('Please correct the user name or password.'));
165+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
166166
}
167167
} catch (PluginAuthenticationException $e) {
168168
$this->_eventManager->dispatch(
@@ -175,7 +175,9 @@ public function login($username, $password)
175175
'backend_auth_user_login_failed',
176176
['user_name' => $username, 'exception' => $e]
177177
);
178-
self::throwException(__($e->getMessage()? : 'Please correct the user name or password.'));
178+
self::throwException(
179+
__($e->getMessage()? : 'You did not sign in correctly or your account is temporarily disabled.')
180+
);
179181
}
180182
}
181183

app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,78 @@ public function testAroundDispatchProlongStorage()
8484

8585
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
8686
}
87+
88+
/**
89+
* Calls aroundDispatch to access protected method _processNotLoggedInUser
90+
*
91+
* Data provider supplies different possibilities of request parameters and properties
92+
* @dataProvider processNotLoggedInUserDataProvider
93+
*/
94+
public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForwardedFlag)
95+
{
96+
$subject = $this->getMockBuilder('Magento\Backend\Controller\Adminhtml\Index')
97+
->disableOriginalConstructor()
98+
->getMock();
99+
$request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
100+
->disableOriginalConstructor()
101+
->getMock();
102+
$storage = $this->getMockBuilder('Magento\Backend\Model\Auth\Session')
103+
->disableOriginalConstructor()
104+
->getMock();
105+
106+
// Stubs to control the flow of execution in aroundDispatch
107+
$this->auth->expects($this->any())->method('getAuthStorage')->will($this->returnValue($storage));
108+
$request->expects($this->once())->method('getActionName')->will($this->returnValue('non/open/action/name'));
109+
$this->auth->expects($this->any())->method('getUser')->willReturn(false);
110+
$this->auth->expects($this->once())->method('isLoggedIn')->will($this->returnValue(false));
111+
$request->expects($this->any())->method('getPost')->willReturn(false);
112+
113+
// Test cases and expectations based on provided data
114+
$request->expects($this->once())->method('isForwarded')->willReturn($isForwardedFlag);
115+
$getParamCalls = 0;
116+
$actionName = '';
117+
118+
// If forwarded flag is set, getParam never gets called
119+
if (!$isForwardedFlag) {
120+
if ($isIFrameParam) {
121+
$getParamCalls = 1;
122+
$actionName = 'deniedIframe';
123+
} else if ($isAjaxParam) {
124+
$getParamCalls = 2;
125+
$actionName = 'deniedJson';
126+
} else {
127+
$getParamCalls = 2;
128+
$actionName = 'login';
129+
}
130+
}
131+
132+
$requestParams = [
133+
['isIframe', null, $isIFrameParam],
134+
['isAjax', null, $isAjaxParam]
135+
];
136+
137+
$setterCalls = $isForwardedFlag ? 0 : 1;
138+
$request->expects($this->exactly($getParamCalls))->method('getParam')->willReturnMap($requestParams);
139+
$request->expects($this->exactly($setterCalls))->method('setForwarded')->with(true)->willReturnSelf();
140+
$request->expects($this->exactly($setterCalls))->method('setRouteName')->with('adminhtml')->willReturnSelf();
141+
$request->expects($this->exactly($setterCalls))->method('setControllerName')->with('auth')->willReturnSelf();
142+
$request->expects($this->exactly($setterCalls))->method('setActionName')->with($actionName)->willReturnSelf();
143+
$request->expects($this->exactly($setterCalls))->method('setDispatched')->with(false)->willReturnSelf();
144+
145+
$expectedResult = 'expectedResult';
146+
$proceed = function ($request) use ($expectedResult) {
147+
return $expectedResult;
148+
};
149+
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
150+
}
151+
152+
public function processNotLoggedInUserDataProvider()
153+
{
154+
return [
155+
'iFrame' => [true, false, false],
156+
'Ajax' => [false, true, false],
157+
'Neither iFrame nor Ajax' => [false, false, false],
158+
'Forwarded request' => [true, true, true]
159+
];
160+
}
87161
}

0 commit comments

Comments
 (0)