Skip to content

Commit bc9c583

Browse files
committed
MAGETWO-35242: [IE] A product image can be added only after double click
1 parent f340c06 commit bc9c583

File tree

1 file changed

+10
-6
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 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
/**
@@ -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
}

0 commit comments

Comments
 (0)