Skip to content

Commit f5b1626

Browse files
author
Natalia Momotenko
committed
Merge remote-tracking branch 'origin/develop' into UI
2 parents c652b40 + c0eef7c commit f5b1626

File tree

22 files changed

+76
-55
lines changed

22 files changed

+76
-55
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
class Upload extends \Magento\Backend\App\Action
1212
{
1313
/**
14-
* @var \Magento\Framework\Controller\Result\JsonFactory
14+
* @var \Magento\Framework\Controller\Result\RawFactory
1515
*/
16-
protected $resultJsonFactory;
16+
protected $resultRawFactory;
1717

1818
/**
1919
* @param \Magento\Backend\App\Action\Context $context
20-
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
20+
* @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
2121
*/
2222
public function __construct(
2323
\Magento\Backend\App\Action\Context $context,
24-
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
24+
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory
2525
) {
2626
parent::__construct($context);
27-
$this->resultJsonFactory = $resultJsonFactory;
27+
$this->resultRawFactory = $resultRawFactory;
2828
}
2929

3030
/**
@@ -36,7 +36,7 @@ protected function _isAllowed()
3636
}
3737

3838
/**
39-
* @return \Magento\Framework\Controller\Result\Json
39+
* @return \Magento\Framework\Controller\Result\Raw
4040
*/
4141
public function execute()
4242
{
@@ -72,6 +72,10 @@ public function execute()
7272
$result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
7373
}
7474

75-
return $this->resultJsonFactory->create()->setData($result);
75+
/** @var \Magento\Framework\Controller\Result\Raw $response */
76+
$response = $this->resultRawFactory->create();
77+
$response->setHeader('Content-type', 'text/plain');
78+
$response->setContents(json_encode($result));
79+
return $response;
7680
}
7781
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function execute()
9090
if ($storeId) {
9191
$product->setStoreId($storeId);
9292
}
93-
$setId = $this->getRequest()->getPost('set');
93+
$setId = $this->getRequest()->getPost('set') ?: $this->getRequest()->getParam('set');
9494
if ($setId) {
9595
$product->setAttributeSetId($setId);
9696
}

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ValidateTest.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class ValidateTest extends \Magento\Catalog\Test\Unit\Controller\Adminhtml\Produ
2828
protected $initializationHelper;
2929
/** @var \Magento\Catalog\Model\ProductFactory|\PHPUnit_Framework_MockObject_MockObject */
3030
protected $productFactory;
31-
/** @var \Magento\Framework\Controller\Result\JSON|\PHPUnit_Framework_MockObject_MockObject */
31+
/** @var \Magento\Framework\Controller\Result\Json|\PHPUnit_Framework_MockObject_MockObject */
3232
protected $resultJson;
33-
/** @var \Magento\Framework\Controller\Result\JSONFactory|\PHPUnit_Framework_MockObject_MockObject */
33+
/** @var \Magento\Framework\Controller\Result\JsonFactory|\PHPUnit_Framework_MockObject_MockObject */
3434
protected $resultJsonFactory;
3535

3636
protected function setUp()
@@ -104,8 +104,8 @@ protected function setUp()
104104
->getMock();
105105
$this->productFactory->expects($this->any())->method('create')->willReturn($this->product);
106106

107-
$this->resultJson = $this->getMock('Magento\Framework\Controller\Result\JSON', [], [], '', false);
108-
$this->resultJsonFactory = $this->getMockBuilder('Magento\Framework\Controller\Result\JSONFactory')
107+
$this->resultJson = $this->getMock('Magento\Framework\Controller\Result\Json', [], [], '', false);
108+
$this->resultJsonFactory = $this->getMockBuilder('Magento\Framework\Controller\Result\JsonFactory')
109109
->disableOriginalConstructor()
110110
->setMethods(['create'])
111111
->getMock();
@@ -126,15 +126,21 @@ protected function setUp()
126126
);
127127
}
128128

129-
/**
130-
* @return void
131-
*/
132-
public function testAttributeSetIsObtainedFromPost()
129+
public function testAttributeSetIsObtainedFromPostByDefault()
133130
{
131+
$this->request->expects($this->any())->method('getParam')->willReturnMap([['set', null, 4]]);
134132
$this->request->expects($this->any())->method('getPost')->willReturnMap([['set', null, 9]]);
135-
136133
$this->product->expects($this->once())->method('setAttributeSetId')->with(9);
137134

138135
$this->action->execute();
139136
}
137+
138+
public function testAttributeSetIsObtainedFromGetWhenThereIsNoOneInPost()
139+
{
140+
$this->request->expects($this->any())->method('getParam')->willReturnMap([['set', null, 4]]);
141+
$this->request->expects($this->any())->method('getPost')->willReturnMap([['set', null, null]]);
142+
$this->product->expects($this->once())->method('setAttributeSetId')->with(4);
143+
144+
$this->action->execute();
145+
}
140146
}

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
<?php $_divId = 'tree-div_' . time() ?>
1212
<div id="<?php echo $_divId ?>" class="tree"></div>
13-
13+
<!--[if IE]>
14+
<script id="ie-deferred-loader" defer="defer" src=""></script>
15+
<![endif]-->
1416
<script>
1517
require([
1618
'jquery',

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
<div><?php echo __('This operation can take much time'); ?></div>
3636
</div>
3737
</div>
38-
38+
<!--[if IE]>
39+
<script id="ie-deferred-loader" defer="defer" src=""></script>
40+
<![endif]-->
3941
<script>
4042
var tree;
4143
require([

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
<?php $_divId = 'tree' . $block->getId() ?>
1212
<div id="<?php echo $_divId ?>" class="tree"></div>
13-
13+
<!--[if IE]>
14+
<script id="ie-deferred-loader" defer="defer" src=""></script>
15+
<![endif]-->
1416
<script>
1517
require(['jquery', "prototype", "extjs/ext-tree-checkbox"], function(jQuery){
1618

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ require([
3838
<span class="title"><?php echo __('Unassigned Attributes') ?></span>
3939
</div>
4040
<div id="tree-div2" class="attribute-set-tree"></div>
41+
<!--[if IE]>
42+
<script id="ie-deferred-loader" defer="defer" src=""></script>
43+
<![endif]-->
4144
<script>
42-
require(["jquery", "extjs/ext-tree-checkbox", "prototype"], function(jQuery){
45+
define("tree-panel", ["jquery", "extjs/ext-tree-checkbox", "prototype"], function(jQuery){
4346

4447
//<![CDATA[
4548
var allowDragAndDrop = <?php echo($block->getIsReadOnly() ? 'false' : 'true'); ?>;
@@ -406,6 +409,7 @@ require(["jquery", "extjs/ext-tree-checkbox", "prototype"], function(jQuery){
406409
//]]>
407410

408411
});
412+
require(["tree-panel"]);
409413
</script>
410414
</div>
411415
</div>

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
?>
1111
<script>
12-
require(['jquery'], function(){
12+
require(["tree-panel"], function(){
1313
ConfigurableNodeExists = function(currentNode) {
1414
for (var i in currentNode.childNodes ) {
1515
if (currentNode.childNodes[i].id) {

app/code/Magento/DesignEditor/view/adminhtml/templates/editor/tools/files/tree.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
</div>
2929

3030
<div id="tree" style="width:100%; overflow:auto;"></div>
31-
31+
<!--[if IE]>
32+
<script id="ie-deferred-loader" defer="defer" src=""></script>
33+
<![endif]-->
3234
<script>
3335
require([
3436
'jquery',

app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<div class="actions"><?php echo $block->getAddLayoutButtonHtml() ?></div>
1616
</div>
1717
</fieldset>
18+
<!--[if IE]>
19+
<script id="ie-deferred-loader" defer="defer" src=""></script>
20+
<![endif]-->
1821
<script>
1922
require([
2023
'jquery',

0 commit comments

Comments
 (0)