Skip to content

Commit 477bea4

Browse files
author
Alexander Akimov
authored
Merge pull request #2690 from magento-tsg/2.1-develop-pr54
[TSG] Backporting for 2.1 (pr54) (2.1.15)
2 parents b91b8f2 + a018521 commit 477bea4

File tree

10 files changed

+45
-22
lines changed

10 files changed

+45
-22
lines changed

app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function execute()
3232
$aclResource = $component->getData('acl');
3333

3434
if ($aclResource && !$this->_authorization->isAllowed($aclResource)) {
35-
$this->_redirect('admin/noroute');
35+
if (!$this->_request->isAjax()) {
36+
$this->_redirect('admin/noroute');
37+
}
38+
3639
return;
3740
}
3841

app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ public function testExecuteAjaxRequestWithoutPermissions($acl, $isAllowed)
149149
->method('getParam')
150150
->with('namespace')
151151
->willReturn($name);
152+
153+
if ($isAllowed === false) {
154+
$this->requestMock->expects($this->once())
155+
->method('isAjax')
156+
->willReturn(true);
157+
}
158+
159+
$this->responseMock->expects($this->never())
160+
->method('setRedirect');
152161
$this->responseMock->expects($this->any())
153162
->method('appendBody')
154163
->with($renderedData);

app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ define([
304304

305305
if (allowed.passed) {
306306
target.on('fileuploadsend', function (event, postData) {
307-
postData.data.set('param_name', this.paramName);
307+
postData.data.append('param_name', this.paramName);
308308
$(event.currentTarget).off('fileuploadsend');
309309
}.bind(data));
310310

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"monolog/monolog": "1.16.0",
4141
"oyejorge/less.php": "~1.7.0",
4242
"pelago/emogrifier": "0.1.1",
43-
"tubalmartin/cssmin": "2.4.8-p4",
43+
"tubalmartin/cssmin": "3.0.0",
4444
"magento/magento-composer-installer": "*",
4545
"braintree/braintree_php": "3.7.0",
4646
"symfony/console": "~2.3 <2.7",

composer.lock

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Framework/View/_files/static/expected/styles.magento.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6116,3 +6116,9 @@ table tfoot tr td:last-child {
61166116
content: ' Test\';\A}' "\A" '\A.test + .test._other ~ ul > li' " {\A height: @var;\A content: ' + ';\A}";
61176117
white-space: pre;
61186118
}
6119+
.test-content-calc {
6120+
width: calc((100% / 12 * 2) - 10px);
6121+
}
6122+
.test-svg-xml-image {
6123+
background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 38 40"><style>.st0{fill:none;stroke:%23ffffff;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}</style><circle cx="14.7" cy="14.7" r="13.7" class="st0"/><path d="M23.9 24.7L37 39" class="st0"/></svg>') no-repeat left center;
6124+
}

lib/internal/Magento/Framework/Code/Minifier/Adapter/Css/CSSmin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Framework\Code\Minifier\Adapter\Css;
77

8-
use CSSmin as CssMinLibrary;
8+
use tubalmartin\CssMin\Minifier as CssMinLibrary;
99
use Magento\Framework\Code\Minifier\AdapterInterface;
1010

1111
/**
@@ -35,12 +35,12 @@ public function __construct(CssMinLibrary $cssMinifier)
3535
/**
3636
* Get CSS Minifier
3737
*
38-
* @return \CSSMin
38+
* @return CssMinLibrary
3939
*/
4040
private function getCssMin()
4141
{
42-
if (!($this->cssMinifier instanceof \CSSMin)) {
43-
$this->cssMinifier = new \CSSmin(false);
42+
if (!($this->cssMinifier instanceof CssMinLibrary)) {
43+
$this->cssMinifier = new CssMinLibrary(false);
4444
}
4545
return $this->cssMinifier;
4646
}

lib/internal/Magento/Framework/Code/Test/Unit/Minifier/Adapter/Css/CssMinTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CssMinTest extends \PHPUnit_Framework_TestCase
99
{
1010
public function testMinify()
1111
{
12-
$cssMinMock = $this->getMockBuilder(\CSSmin::class)
12+
$cssMinMock = $this->getMockBuilder(\tubalmartin\CssMin\Minifier::class)
1313
->disableOriginalConstructor()
1414
->getMock();
1515
$cssMinAdapter = new \Magento\Framework\Code\Minifier\Adapter\Css\CSSmin($cssMinMock);

lib/internal/Magento/Framework/View/Result/Layout.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ public function renderResult(ResponseInterface $response)
160160
\Magento\Framework\Profiler::start('LAYOUT');
161161
\Magento\Framework\Profiler::start('layout_render');
162162

163+
$this->eventManager->dispatch('layout_render_before');
164+
$this->eventManager->dispatch('layout_render_before_' . $this->request->getFullActionName());
165+
163166
$this->applyHttpHeaders($response);
164167
$this->render($response);
165168

166-
$this->eventManager->dispatch('layout_render_before');
167-
$this->eventManager->dispatch('layout_render_before_' . $this->request->getFullActionName());
168169
\Magento\Framework\Profiler::stop('layout_render');
169170
\Magento\Framework\Profiler::stop('LAYOUT');
170171
return $this;

0 commit comments

Comments
 (0)